PRANAY's 18th August 2025


Today after a hectic day at college I solved the TLE ELIMINATOR CP-31 sheet which is a great resource for any one who want to have a taste of CP with Leetcode
The fifth Question TLE CP-31 was Jagged Swaps
—>My take on this was that it might be a good question but it came out to be simple as in this question we were given with a permutation (A permutation is a array which has elements from 1 to array.length simply) and we have to tell if i can sort it or not given some condition . My brain quickly clicked that the only thing i had to check was if the first digit of permutation was 1 or not and the problem got solved in no time .
The sixth question of the TLE CP-31 sheet was Doremy's Paint 3
—>Earlier i thought to solve this question without hashmap but it was biut tricky and led to wrong submission as well so i switched to simplicity of HashMap but i will try to find why my variable solution didnt worked .Overall it was a easy problem where the simple relation that alternate values in the array must be same reduced the question to a easy level problem .
After solving few questions from the list i decided to do some leetcode and i started with the Question of the day which was 24Game .At first I was unsure if i could do it as i was a hard problem but it used onyl bactracking and no DP so i decided to give it a try .I felt parenthesis as a rpoblem but there werent ,they were just telling me the sequence in i have to to apply operation to elements which i am doing using backtracking so they were not the problem ,but the floating division was . I handled it by using Math.abs(val - 24.0) < EPS where eps was 1e-5 or 10^-5 which solved my problem of off by few decimal places of 24.
Also I solved Evaluate Boolean Binary Tree
In this question i initially got confused to modify the value or not but later i decided lets not modify the value and return the values of children directly to the parent hence simplyifying the question.
Subscribe to my newsletter
Read articles from PRANAY JAISWAL directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
