Problem
Return the number of times that the string "code" appears anywhere in the given string, except we'll accept any letter for the 'd', so "cope" and "cooe" count.
Example
solution('aaacodebbb ...
Write a function that decides if a student passes a course or not and returns result. The function receives 2 integer parameters ; first grade and then attendance percentage. If the attendance is bel ...
Problem
Return the sum of the numbers in the array, except ignore sections of numbers starting with a 6 and extending to the next 7 (every 6 will be followed by at least one 7).
Example
solution([ ...
Problem
Given a number n, return True if n is in the range 1..10, both are included.
Unless outSideMode is True, in which case return True if the number is less or equal to 1, or greater or equal t ...
Write a function that gets an integer num = 20 as argument than returns sum of all integer numbers up to and including number
Example Solution
When the function called with following input num = 10 ...
Colleen is turning n years old! Therefore, she has n candles of various heights on her cake, and candle i has height heighti . Because the taller candles tower over the shorter ones, Colleen can on ...
A Hippodrome is organizing a new type of horse racing: duals. During a dual, only two horses will participate in the race. In order for the race to be interesting, it is necessary to try to select tw ...
Implement wildcard pattern matching with support for '?' and '*'.
'?' : Matches any single character.
'*' : Matches any sequence of characters (including the empty sequence).
The matching should cov ...
Given an array of size n, find the majority element. The majority element is the element that appears more than floor(n/2) times.
You may assume that the array is non-empty and the majority element ...