AtCoder Beginners Contest 082 [A to C]

Tasks

 

A. Round Up The Mean … Round up using math.ceil

 

B. Two Anagrams … make the ascending ordered string from s, and make the descending ordered string from t. Compare both of them. The for loop needs to have three conditions as first condition checks if s-string is shorter than t-string, the second condition checks if t-string is shorter than s-string OR the pointing character in t-string is bigger than the same index character in s-string. We cannot include s_chr < t_chr in the first condition as it will cause Error “None cannot be compared with int” if t-string is shorter than s-string.

 

C. Good Sequence … I used collections.Counter function again. It makes this tasks very easy. Once dictionary is populated, I just need to go through all the keys and compare the key and value.