Showing 6 posts tagged with "c"
C++ Solution for LeetCode 2594. Minimum Time to Repair Cars
long long repairCars(vector& ranks, int cars) { //long long min_r = *min_element(ranks.begin(), ranks.end()); long long left = 1; long long right = ranks[0] ...
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++ ...
Zigzag string conversion solution in C++
The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this Input: s = "PAYPALISHIRING", numRows = 3 Output: "PAHNAPLSIIGY...
Search Sorted Matrix Solution in C++
The idea here is to implement binary search after discovering the correct row. #include <bits/stdc++.h> using namespace std; class Solution { public: // F...
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 ...
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: ["((()...
