shlogg · Early preview
Md Ariful Haque @mah-shamim

I am a Technical Lead with holistic knowledge of software development and design. I am also experienced in coordinating with stakeholders

Laravel Third Party API Integration Guide In 8 Steps

Integrate 3rd party APIs in Laravel with step-by-step guide & examples: set up API keys, install Guzzle, create service class, bind service, define routes & build view.

Largest Combination With Bitwise AND Greater Than Zero

Find largest combination of candidates with bitwise AND > 0. Count numbers with set bits at each position (0-23). Return max count as largest combination size.

Minimum Changes To Make Binary String Beautiful In 60 Characters

Make binary string beautiful by partitioning into substrings with even length & only 1's or 0's. Change minority char in each block to match majority. Time complexity: O(n), space complexity: O(1).

String Compression III: Compressing Strings With PHP

Compress string using greedy approach: take longest prefix of repeating chars (up to 9) and append count & char. Example: 'abcde' -> '1a1b1c1d1e', 'aaaaaaaaaaaaaabb' -> '9a5a2b

Check If String Can Become Goal Through Rotations In PHP

Rotate string s into goal by checking if goal is a substring of s + s. If lengths match and goal exists in doubleS, return true; otherwise, false. Time complexity: O(n), space complexity: O(n).

Minimum Removals To Make Mountain Array

Given an array nums, return min elements to remove to make it a mountain array. Use dynamic programming to find max mountain subsequence and compute min removals.

Maximum Moves In Grid With Dynamic Programming

Dynamic Programming solution for Maximum Number of Moves in a Grid: Initialize dp array with 0s, traverse grid from last column to first, update dp values based on possible moves, and return max value in first column.

12 Key Takeaways From Solving Over 200 LeetCode Problems

Pattern recognition is key to solving LeetCode problems. Consistently reinforcing algorithmic foundations & optimizing problem-solving approaches helps tackle complex problems with ease.

Laravel's SaveQuietly(): Silently Saving Models Without Events

In Laravel, use `saveQuietly()` to update models silently, bypassing events like logging & notifications, ideal for bulk updates or admin overrides.

Splitting Strings Into Max Unique Substrings

Split string into max unique substrings using backtracking & set for uniqueness. Recursive function explores all possible substrings, backtracks if repetition occurs.

Counting Maximum Bitwise-OR Subsets In PHP

Count Number of Maximum Bitwise-OR Subsets: Calculate max bitwise OR, enumerate subsets (2^n), count valid subsets with max OR. PHP solution for arrays up to size 16.

Longest Happy String With Greedy Approach

We can use a greedy algorithm to find the longest happy string by using a Priority Queue (Max Heap) and continuously extracting the character with the highest count while ensuring we don't exceed two consecutive occurrences of the same character.