Problem 174253 · easy · Phase 01 Prerequisites & Setup

Hashtag Maker

strings · split · capitalize · join

Turn a phrase into a hashtag: capitalise every word (first letter upper, rest lower), remove the spaces, and put # in front. Extra spaces anywhere are ignored. If the phrase contains no words, return "#".

Examples

Input:  phrase = "hello world"
Output: "#HelloWorld"

Input:  phrase = "  pYTHON is   FUN "
Output: "#PythonIsFun"

Constraints

  • 0 <= len(phrase) <= 500
  • phrase may contain letters, digits and spaces

Goals

  • Capitalise each word
  • Join words with no separator
  • Add a prefix
Starting Python…