r/AlgoExpert • u/alpha-037 • Jun 15 '21
All AlgoExpert Questions and Solutions in Java
This repo consists of all the AlgoExpert questions and their solutions. Feel free to star/fork it.
Happy problem solving!
r/AlgoExpert • u/alpha-037 • Jun 15 '21
This repo consists of all the AlgoExpert questions and their solutions. Feel free to star/fork it.
Happy problem solving!
r/AlgoExpert • u/alpha-037 • Mar 04 '21
I've started adding solutions to the AlgoExpert problems. You find them in this repository.
You can check them out. They're in Java. Some of the solutions I'll be adding won't be similar to the solutions they're providing.
Also, please ⭐ it if you like it. Let's create free resources for developers!
r/AlgoExpert • u/krishnan_navadia • Jan 22 '20
You are given an array of integers. Return the largest product that can be made by multiplying any 3 integers in the array.
Example:
Input:
[-4, -4, 2, 8]
Output:
128
Explanation:
[-4, -4, 2, 8] should return 128 as the largest product can be made by multiplying -4 * -4 * 8
= 128.You can comment (solution+ it’s language) for request…
Hope you can solve the question.
r/AlgoExpert • u/krishnan_navadia • Jan 21 '20
Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements.
Example:
Input:
[0,1,0,3,12]
Output:
[1,3,12,0,0]
You can comment (solution+ it’s language) in request…
Hope you can solve the question
r/AlgoExpert • u/evermore88 • Apr 27 '21
I want to buy algoexpert does anyone have promo code or coupons?
thank you
r/AlgoExpert • u/krishnan_navadia • Jan 29 '20
Given two strings A and B of lowercase letters, return true if and only if we
can swap two letters in A so that the result equals B.
Example:
Input:
A = "ab", B = "ba"
Output:
True
Input 2:
A = "ab", B = "ab"
Output 2:
False
Input 3:
A = "aa", B = "aa"
Output 3:
True
Input 4:
A = "aaaaaaabc", B = "aaaaaaacb"
Output 4:
True
r/AlgoExpert • u/krishnan_navadia • Jan 23 '20
Given a multiset of integers, return whether it can be partitioned into two subsets whose sums are the same.
Example:
Input:
{15, 5, 20, 10, 35, 15, 10}
Output:
True
Explanation -
Given the multiset {15, 5, 20, 10, 35, 15, 10}, it would return true, since we can split it up into {15, 5, 10, 15, 10} and {20, 35}, which both add up to 55.
Given the multiset {15, 5, 20, 10, 35}, it would return false, since we can't split it up into two subsets that add up to the same sum.
r/AlgoExpert • u/BetaCulture • Aug 03 '23
Hey anyone know what whiteboard tool Clement uses in his lectures?
r/AlgoExpert • u/[deleted] • Jun 24 '22
I am preparing for interviews and doing leetcode following the Neetcode channel in youtube. But the only problem it has is they do not explain the complexities completely. Is algoexpert better in that respect ? Is it really worth it ?
r/AlgoExpert • u/nioooin • Oct 22 '21
Which is better? Edit: leetcode or AlgoExpert (can't edit the subject, damn autocorrect)
r/AlgoExpert • u/krishnan_navadia • Jan 30 '20
On our special chessboard, two bishops attack each other if they share the same
diagonal. This includes bishops that have another bishop located between them,
i.e. bishops can attack through pieces.
You are given N bishops, represented as (row, column) tuples on a M by M
chessboard. Write a function to count the number of pairs of bishops that attack
each other. The ordering of the pair doesn't matter: (1, 2) is considered the
same as (2, 1).
For example, given M = 5 and the list of bishops:
* (0, 0)
* (1, 2)
* (2, 2)
* (4, 0)
The board would look like this:
[b 0 0 0 0]
[0 0 b 0 0]
[0 0 b 0 0]
[0 0 0 0 0]
[b 0 0 0 0]
You should return 2, since bishops 1 and 3 attack each other, as well as bishops
3 and 4.
r/AlgoExpert • u/hackerzzzz • Jul 17 '22
r/AlgoExpert • u/shubhsheth • Jan 05 '22
r/AlgoExpert • u/ruffles_gaming • Feb 15 '21
It usually takes me an hour or two to solve a problem on algoexpert, but I’m stuck on one for more than 6 hours. Should I just give up and watch the solution video?
r/AlgoExpert • u/shubhsheth • Dec 20 '20
r/AlgoExpert • u/krishnan_navadia • Feb 11 '20
Given an array, nums , of n integers, find all unique triplets (three numbers, a, b, & c) in nums such that a + b + c = 0. Note that there may not be any triplets that sum to zero in nums , and that the triplets must not be duplicates.
Input:
[0, -1, 2, -3, 1]
Output:
[0, -1, 1], [2, -3, 1]
r/AlgoExpert • u/krishnan_navadia • Jan 28 '20
Given a N by M matrix of numbers, print out the matrix in a clockwise spiral.
Example given matrix is shown in input:
Input:
[[1, 2, 3, 4, 5],
[6, 7, 8, 9, 10],
[11, 12, 13, 14, 15],
[16, 17, 18, 19, 20]]
Output:
1
2
3
4
5
10
15
20
19
18
17
16
11
6
7
8
9
14
13
12
r/AlgoExpert • u/krishnan_navadia • Jan 27 '20
Given a string S, check if the letters can be rearranged so that two characters that are adjacent to each other are not the same.
If possible, output any possible result. If not possible, return the empty string.
Example:
Input:
"aabbc"
Output:
"ababac"
Input 2:
"aaab"
Output 2:
""
r/AlgoExpert • u/krishnan_navadia • Jan 24 '20
You are given an array of intervals - that is, an array of tuples (start, end).
The array may not be sorted, and could contain overlapping intervals. Return
another array where the overlapping intervals are merged.
Example:
Input:
[(1, 3), (5, 8), (4, 10), (20, 25)]
Output:
[(1, 3), (4, 10), (20, 25)]
Explanation -
This input should return [(1, 3), (4, 10), (20, 25)] since (5, 8) and (4, 10) can be merged into (4, 10).
r/AlgoExpert • u/Effective-Ad315 • Jan 09 '24
Did anybody unlock their recruiting profile? Are FAANG recruiters really reaching out to you?
r/AlgoExpert • u/hijibiji_321 • Mar 15 '22
The software used on AlgoExpert for the conceptional overview section is really good. I am thinking of creating videos myself for YouTube, the software used by AlgoExpert seems a really good option, but I don't know what the software is. Anyone knows?
r/AlgoExpert • u/ItsTheWeeBabySeamus • Jan 09 '22