Code Kata - player

    • Workingday(“Monday”) → true
    • Workingday (“Sunday”) → false
    • Workingday (“Tuesday”) → true

      For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotated to [5,6,7,1,2,3,4].
      NOTE:
      Try to come up as many solutions as you can, there are at least 3 different ways to solve this problem.

        A happy number is a number defined by the following process: Starting with any positive integer, replace the number by the sum of the squares of its digits, and repeat the process until the number equals 1 (where it will stay), or it loops endlessly in a cycle which does not include 1. Those numbers for which this process ends in 1 are happy numbers.

        Examble:19 is a happy number

        1. 12 + 92 = 82
        2. 82 + 22 = 68
        3. 62 + 82 = 10
        4. 12 + 02 + 02 = 1
          1. ReverseMe –
            1. Output 1 – eMesreveR
            2. Output 2 - MsrvR
          2. VowelsRemoved
            1. Output 1 – devomeRslewoV
            2. Output 2 - dvmRslwV

            For Example:
            Given"25525511135"
            return ["255.255.11.135", "255.255.111.35"]. (Order does not matter)

              • Note: The numbers can be arbitrarily large and are non-negative.
                • Each child must have at least one candy
                • Children with a higher rating get more candies than their neighbors.

                What is the minimum candies you must give?

                  1. get(key) - Get the value (will always be positive) of the key if the key exists in the cache, otherwise return -1.
                  2. set(key, value) - Set or insert the value if the key is not already present. When the cache reached its capacity, it should invalidate the least recently used item before inserting a new item.
                    1. Some examples:
                      • "0"=>true
                      • "0.1"=>true
                      • "abc"=>false
                      • "1 a" =>false
                      • "2e10" =>true

                      For example,

                      words:: ["This", "is", "an", "example", "of", "text", "justification."]
                      L: 16.

                      1. Return the formatted lines as: ["This is an", "example of text", "justification. " ]
                      2. Note: Each word is guaranteed not to exceedLin length.

                        1. For example,
                        • Given[1,3],[2,6],[8,10],[15,18],
                        • return[1,6],[8,10],[15,18].

                          1. For "(()", the longest valid parentheses substring is "()", which has length = 2.
                          2. Another example is ")()())", where the longest valid parentheses substring is "()()", which has length = 4.

                            Implement regular expression matching with support for '.' and '*'.

                            										'.' Matches any single character.
                            										'*' Matches zero or more of the preceding element.
                            
                            										The matching should cover the entire input string (not partial).
                            
                            										The function prototype should be:
                            										bool isMatch(const char *s, const char *p)
                            
                            										Some examples:
                            										a.	isMatch("aa","a") → false
                            										b.	isMatch("aa","aa") → true
                            										c.	isMatch("aaa","aa") → false
                            										d.	isMatch("aa", "a*") → true
                            										e.	isMatch("aa", ".*") → true
                            										f.	isMatch("ab", ".*") → true
                            										g.	isMatch("aab", "c*a*b") → true
                            
                            							      	

                              Note:

                              • Elements in a subset must be in non-descending order.
                              • The solution set must not contain duplicate subsets.
                              For Examble,
                              if Nums= [1,2,2],a solution is:
                                [
                                [2],
                                [1],
                                [1,2,2],
                                [2,2],
                                [1,2],
                                []
                                ]
                              
                              							      	

                                There are some rules to a Roman number:

                                • Numerals can be concatenated to form a larger numeral ("XX" + "II" = "XXII")
                                • If a lesser numeral is put before a bigger it means subtraction of the lesser from the bigger ("IV" means four, "CM" means ninehundred)
                                • If the numeral is I, X or C you can't have more than three ("II" + "II" = "IV")
                                • If the numeral is V, L or D you can't have more than one ("D" + "D" = "M")
                                clues
                                String grouping and concatenation is key to solving this kata. But remember the rule that lesser numerals can preceede bigger ones.

                                  There are some rules to a Roman number:

                                  • ex. factorialZeroCount(10)
                                  • 10! = 3,628,800
                                  • returns: 2

                                  • ex 2. factorialZeroCount(27)
                                  • 27! = 10,888,869,450,418,352,160,768,000,000
                                  • returns: 6