CodeNFlex Profile Banner
Ashish Saini Profile
Ashish Saini

@CodeNFlex

Followers
47
Following
285
Media
252
Statuses
297

Software Engineer | Cybersecurity Enthusiast | Backend Engineering Specialist | Passionate about DSA, OOP, Java, Spring Boot, AWS, React, and more 🚀 |

New Delhi
Joined December 2023
Don't wanna be here? Send us removal request.
@CodeNFlex
Ashish Saini
11 months
Don’t stress when it feels like everyone around you is earning money or moving ahead. We all have our own journey, and nothing great happens overnight. Stay focused, keep going, and don’t let laziness hold you back. Think about giving your family the life they deserve. Remember.
1
0
5
@CodeNFlex
Ashish Saini
1 month
Leetcode POTD 2966(Medium) : Divide Array Into Arrays With Max Difference.Approach Summary:.The solution first sorts the input array, then iterates through it in steps of 3, checking the condition for the difference between the maximum and minimum elements. If the condition is
Tweet media one
0
0
1
@CodeNFlex
Ashish Saini
1 month
"Leetcode POTD 3405(Hard) : Count the Number of Arrays with K matching Adjacent Elements".Approach Summary:.We precompute factorials and their modular inverses using Fermat's Little Theorem to efficiently calculate combinations. The total number of good arrays is determined by
Tweet media one
0
0
1
@CodeNFlex
Ashish Saini
1 month
GitHub is down. Guess it’s time for a coffee break ☕️ #GitHubDown.
0
0
1
@CodeNFlex
Ashish Saini
1 month
Leetcode POTD 2016(Easy) : Maximum Difference Between Increasing Elements.Approach Summary:.The approach iterates through the array while keeping track of the minimum element seen so far. For each element, it calculates the difference with the minimum and updates the maximum
Tweet media one
0
0
1
@CodeNFlex
Ashish Saini
1 month
"Leetcode POTD 1432(Medium) : Max Difference You Can Get From Changing an Integer".Approach Summary:.The idea is to maximize and minimize the given number by replacing digits. To maximize, we replace the first non-9 digit with 9 across the number. To minimize, we replace the
Tweet media one
0
0
1
@CodeNFlex
Ashish Saini
1 month
"Leetcode POTD 440(Hard) : K-th Smallest in Lexicographical Order".Approach Summary:.The approach visualizes numbers from 1 to n in lexicographical order as a prefix tree (Trie). Starting with prefix 1, it calculates how many numbers lie under the current prefix using the Count
Tweet media one
0
0
1
@CodeNFlex
Ashish Saini
2 months
"Leetcode POTD 1061(Medium) : Lexicographically Smallest Equivalent String".Approach :.This approach builds a graph connecting equivalent characters from s1 and s2. For each character in baseStr, it uses DFS to explore all connected characters and finds the lexicographically
Tweet media one
0
0
1
@CodeNFlex
Ashish Saini
2 months
"Leetcode POTD 3355(Medium) : Zero Array Transformation I ".Approach Summary:.Approach 1 (Simple Simulation): .This approach applies each query one by one on the array and once all queries are done , we check in the last if the input array has become all zero or not. Approach 2
Tweet media one
0
0
1
@CodeNFlex
Ashish Saini
2 months
"Leetcode POTD 3024(easy) : Type of Triangle".Approach Summary:.Triangle Validity Check: Before classifying the triangle, it checks if the three sides can form a valid triangle using the triangle inequality theorem: For any triangle, the sum of the lengths of any two sides must
Tweet media one
0
0
1
@CodeNFlex
Ashish Saini
2 months
"Leetcode POTD 1931(Hard) : Painting a grid with three different colors".Approach Summary:.The intuition behind this problem lies in breaking down a 2D grid coloring task into column-by-column choices, ensuring that colors follow rules: no two adjacent cells (vertically or
Tweet media one
0
0
1
@CodeNFlex
Ashish Saini
2 months
Easy Peasy🤟
Tweet media one
0
0
0
@CodeNFlex
Ashish Saini
2 months
"Leetcode POTD 2901(Medium) : Longest Unequal Adjacent Group Subsequence II " .Approach Summary:.This problem is solved using a variant of Longest Increasing Subsequence (LIS). We treat each word as a potential end of a valid subsequence and use DP (dp[i]) to store the length of
Tweet media one
0
0
1
@CodeNFlex
Ashish Saini
2 months
"Leetcode POTD 3335(Medium) : Total Characters in String After Transformation I".Approach Summary:.The intuition behind the solution is to simulate t rounds of character transformations based on defined rules: each character shifts forward in the alphabet, and 'z' splits into 'a'
Tweet media one
0
0
1
@CodeNFlex
Ashish Saini
2 months
"Leetcode POTD 1550(Easy) : Three Consecutive Odds".Approach Summary:.Approach 1 (Window of 3 Elements): .This method iterates through the array using a sliding window of size 3. At each step, it checks whether the current element and the next two are all odd numbers. If such a
Tweet media one
0
0
1
@CodeNFlex
Ashish Saini
2 months
"Leetcode POTD 2918(Medium) : Minimum Sum Equal of Two Arrays After Replacing Zeroes".Approach Summary:.The approach focuses on minimizing the total sum of two arrays by replacing each zero with the smallest possible positive integer, which is 1. It then calculates the adjusted
Tweet media one
0
0
1
@CodeNFlex
Ashish Saini
2 months
"Leetcode POTD 3343(Hard) : Count Number of Balanced Permutations".Approach Summary:.The core idea behind the solution is to count permutations where the sum of digits at even indices equals the sum at odd indices. Brute-force checks all permutations, but it's inefficient for
Tweet media one
0
0
1
@CodeNFlex
Ashish Saini
2 months
"Leetcode POTD 3341(Medium) : Find Minimum Timen to Reach Last Room I".Approach Summary:.The approach uses Dijkstra's algorithm to find the minimum time required to reach the bottom-right cell from the top-left cell in a grid. Each cell has a specific time constraint, and the
Tweet media one
0
0
1
@CodeNFlex
Ashish Saini
3 months
"Leetcode 2528(Hard) : Merge Operations for Minimum Travel Time".Approach Summary:.The approach uses top-down dynamic programming with memoization to minimize travel time across n positions, considering up to k merge operations. At each step, we can either skip to the next node
Tweet media one
0
0
1
@CodeNFlex
Ashish Saini
3 months
"Leetcode POTD 1007(Medium) : Minimum Domino Rotations For Equal Row".Approach Summary:.The problem is to make all values in either the top or bottom row of dominoes equal using the minimum number of swaps. Since each domino has values from 1 to 6, we try each possible value (1
Tweet media one
0
0
1
@CodeNFlex
Ashish Saini
3 months
"leetcode POTD 2071 (Hard) : maximum Number of Tasks You can Assign".Approach Summary:.The goal is to assign as many tasks as possible by matching the hardest tasks with the strongest available workers. If a worker isn’t strong enough for a task, we check if giving them a
Tweet media one
0
0
1