We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Nice, but I don't like the entaglement in beautifulDays of the looping through range with the algorithm itself that decides to put an 1 or not depending on the (day - reverse of the day) is divisible or not by k. I would disentangle the looping and the filtering by the problem condition in 2 separate functions, and the algorithm will become more readable.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Beautiful Days at the Movies
You are viewing a single comment's thread. Return to all comments →
Nice, but I don't like the entaglement in beautifulDays of the looping through range with the algorithm itself that decides to put an 1 or not depending on the (day - reverse of the day) is divisible or not by k. I would disentangle the looping and the filtering by the problem condition in 2 separate functions, and the algorithm will become more readable.