Posts Tagged: c++

Showing 20 posts tagged with "c++"

Where to Find GPT-2 Source Code

OpenAI’s Official GitHub Repository: OpenAI released parts of GPT-2’s code in their GitHub repository: github.com/openai/gpt-2. This includes a TensorFlow implementation for the 124M parameter model (smallest v...

Subset Sum Problem from Geeks for Geeks

Here is an explanation of the Dynamic Programming solution for the Subset Sum Problem. Given an array of non-negative integers and a target sum, we need to check if there exists a subset whose elements sum up exactly to...

2206. Divide Array Into Equal Pairs

In this article, we'll explain how to solve LeetCode problem 2206: Divide Array Into Equal Pairs. The problem asks us to determine if we can divide an array of $2n$ integers into $n$ pairs such that each element in a pa...

Apple Interview Loop: React Optimizations and the 2D Matrix Search

Recently, I went through a rigorous, multi-stage interview loop for a Front End Developer position at Apple (contracted via Mphasis). The process consisted of six rounds and required Sunnyvale relocation. It was a compr...

C++ Solution for LeetCode 2594. Minimum Time to Repair Cars

This article explains the solution for LeetCode 2594: Minimum Time to Repair Cars. Given mechanic ranks, where rank $r$ repairs $n$ cars in $r imes n^2$ minutes, we must find the minimum time needed to repair all cars....

Binary Search ---- AGAIN!

Implementing classic binary search. Binary search is an $O(log N)$ algorithm to locate a target element within a sorted array. Algorithm Details We maintain two boundary markers: low and high. In each iteration, w...

Stock Span

The stock span problem is a financial problem where we have a series of daily price quotes for a stock and we need to calculate the span of stock price for all days. The span arr[i] of the stocks price on a gi...

List of Open Source C++ Games

Yeah, there are plenty of open-source C++ games that run on Linux and can help you learn game development. Here are a few solid ones: Godot Engine (with C++ modules) – While Godot mainly uses GDScript, you can exten...

Maximum Score After Splitting a String

Here is an explanation of the C++ solution for LeetCode 1422: Maximum Score After Splitting a String. The objective is to split a binary string s into two non-empty substrings (left and right) and find the maximum sum o...

Zigzag string conversion solution in C++

The Zigzag Conversion problem (LeetCode 6) asks us to write a string in a zigzag pattern across a given number of rows, and then read it row by row. Visualizing Zigzag Movement For numRows = 3: P A H N A P...

Search Sorted Matrix Solution in C++

In this post, we explore a C++ solution to search for a value in a row-column sorted matrix. The matrix is sorted such that each row is sorted in ascending order from left to right, and the first element of any row is g...

LeetCode 543 Diameter of a Binary Tree in C++

Given the root of a binary tree, return the length of the diameter of the tree. The diameter of a binary tree is the length of the longest path between any two nodes in a...

Letter Combinations of a phone number

Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. Return the answer in any order. A mapping of digits to letters (just like o...

LeetCode 20 Valid Parentheses in Typescript

The mental challenge one might experience here is that JavaScript doesn't have abstract data structures like stacks and queues built into the language. Implementations of those structures use an array underneath. So so...

C++ Solution for Generate Parentheses Leetcode Problem #22

Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. Example 1: Input: n = 3 Output: ["((()))","(()())","(())()","()(())","()()()"] Example 2:...

 Find Minimum in Rotated Sorted Array

https://leetcode.com/problems/find-minimum-in-rotated-sorted-array Suppose an array of length n sorted in ascending order is rotated between 1 and n times. For example, the a...

Find the Peek Element in the Array

Peak element https://www.geeksforgeeks.org/problems/peak-elementhttps://leetcode.com/problems/find-peak-elementDifficulty: BasicAccuracy: 38.86%Submissions: 510K+Points: 1 Given an array arr[] where no t...

Merge K Sorted Lists

https://leetcode.com/problems/merge-k-sorted-lists You are given an array of k linked-lists lists, each linked-list is sorted in ascending order. Merge all the linked-lists into one sorted linked-...

Cisco: IoT Solutions Architect

Wrote integrations with various systems using JavaScript in the Cisco Asset Manager product suite.Cisco Systems, Inc., Remote 01/2016 – 02/2019IoT Solutions ArchitectWorked for the Cisco IoT innovations department on the...

Shout out to Mike Funk and Andrej Farkas

  Its so amazing when programmers, that you have never met in person before, reach out to you and help you out, when you need it! I just want to say thank you to these guys: Mike Funk Andrej Farkas They...