Tony's Log HackerRank "AND xor OR" Actually I think problem statement is somewhat misleading. No need to mention range [L, R] at all. The intention is a variation to "Largest Rectangle" which is a classic stack problem on LeetCode. But you need to run Largest Rectangle twice: increased...
Actually I think problem statement is somewhat misleading. No need to mention range [L, R] at all. The intention is a variation to "Largest Rectangle" which is a classic stack problem on LeetCode. But you need to run Largest Rectangle twice: increased and decreased. #include <cmath>#incl...
Really interesting problem! My 1st solution was DP based, like bottom-up pattern, but it got TLE since it is O(n^2). Then I thought there must be a O(n) solution. And yes there is :) It is an art of counting - what you learnt in your Combinatorics class :) #include <cmath>...
Find the digital root Challenge│Solution Create a class supporting insert, max, min, mean, mode in O(1) Challenge│Solution Determine if a number is a power of two Challenge│Solution Add two numbers without the + or - sign Challenge│Solution Subtract two numbers without the + or - sign...
Hackerrank Solution Snippets Added soltions to hackerrank questions Oct 15, 2020 Hacktoberfest2020 added styles to hacktoberfest2020 file, also created an animation for… Oct 19, 2020 HandwrittenDigitrecognitionWebApp Added files via upload Oct 7, 2020 ...
(or SJF) CPU Scheduling Python Program Zig-Zag Traversal of Binary Tree in Python Count occurrences of items in Python List Largest Rectangle Hackerrank Solution in Python Unemployment Data Analysis using Python Binary Search Tree in Python Classes and Objects in Python Jump Statement in Python-...
Update: I write stuffHerein Bengali. I probably have one or two basic DP tutorials too. If you understand Bengali, it may help. Note: If you have some other tutorial links and nice problems, mention them. I'll add them here. It'll help me too. ...
so when you are taking xor with i , that means you are taking roughly count/2 numbers and changing it to x^i . That means roughly count/2 element count increase for x^i . as K will be very huge and you make state for odd and even operations . - See code Solution → Reply ...
(or SJF) CPU Scheduling Python Program Zig-Zag Traversal of Binary Tree in Python Count occurrences of items in Python List Largest Rectangle Hackerrank Solution in Python Unemployment Data Analysis using Python Binary Search Tree in Python Classes and Objects in Python Jump Statement in Python-...
HackerRank "Xor and Sum" Actually I think it should belong to category of 'Bits Manipulation'.. but still, a really good one. My first reaction was, how to derive from a ^ (b << i) from a ^ (b << (i - 1)), but after some thoughts, I figured out that that should not be...