bogotech

Helping engineers with technical interviews

Leetcode 463 Island Perimeter

Leetcode 463 Island Perimeter Solved

You are given row x col grid representing a map where grid[i][j] = 1 represents land and grid[i][j] = 0 represents water. Grid cells are connected horizontally/vertically (not diagonally). The grid is completely surrounded by water, and there is exactly one island (i.e., one or more connected land cells). The island doesn’t have “lakes”, meaning the water inside isn’t connected to the water around the island. One […]

Read More
Leetcode 463 Island Perimeter

Busy Intersection Leetcode Solved

Given a list of cars traveling from point start to end with speed in the format [start, end, speed]. You need to return the list of smallest intervals (segments) and the average speed of vehicles in each of those intervals. Used for road color coding as per traffic prediction used in google maps or lately uber. The problem involves processing a list of cars […]

Read More
Leetcode 463 Island Perimeter

Leetcode 724 Find Pivot Index

Given an array of integers nums, calculate the pivot index of this array. The pivot index is the index where the sum of all the numbers strictly to the left of the index is equal to the sum of all the numbers strictly to the index’s right. If the index is on the left edge […]

Read More
Static Code Analysis Tools for Ruby

Backtracking Algorithm

Backtracking is a technique used in computer programming to find all possible solutions to a problem by systematically searching through a large set of potential solutions. It is particularly useful for problems where the solution needs to satisfy a set of constraints and the constraints become increasingly complex as the solution is built. Backtracking algorithms […]

Read More
Leetcode 463 Island Perimeter

Group Anagrams

The “Group Anagrams” problem is a common coding challenge that is often given to software engineers during technical interviews. Essentially, the problem involves grouping a list of words into sets of anagrams – that is, words that are made up of the same letters but in a different order. For example, the words “listen” and […]

Read More
Leetcode 463 Island Perimeter

Implement strStr()

strStr() is a function that takes two strings as input, haystack and needle, and returns the index of the first occurrence of needle in haystack, or -1 if needle is not present in haystack. For example, if haystack = “hello world” and needle = “world”, then the function should return 6, because “world” first appears […]

Read More
Leetcode 463 Island Perimeter

Valid Palindrome

A palindrome is a word, phrase, or sequence of characters that reads the same backward as forward. For example, “racecar” is a palindrome because it is spelled the same way forwards and backwards. A valid palindrome is a palindrome that also meets certain conditions. One common condition is that spaces and punctuation marks are ignored […]

Read More
Leetcode 463 Island Perimeter

Reverse Integer

The Reverse Integer problem is a programming challenge that asks you to reverse the digits of a given integer. For example, if you’re given the number 123, you should return the number 321. Now, it’s important to note that there are a few rules to keep in mind while solving this problem. For one, you […]

Read More
Leetcode 463 Island Perimeter

String to Integer (atoi)

“String to Integer (atoi)” is a coding problem that requires you to convert a given string to its corresponding integer value. Here’s a more detailed explanation of the problem: Problem Statement: Implement the atoi function that converts a string to an integer. The function first discards as many whitespace characters as necessary until the first […]

Read More
Leetcode 463 Island Perimeter

Three Sum Coding Problem Solution

The Three Sum problem is a well-known problem in computer science that involves finding all unique triplets in an array of integers that add up to a target sum. For example, given the array [1, 2, 3, 4, 5, 6, 7] and a target sum of 10, the solution would be [[1, 2, 7], [1, […]

Read More

Page 1 of 5

Powered by WordPress & Theme by Anders Norén