question_slug
stringlengths
3
77
title
stringlengths
1
183
slug
stringlengths
12
45
summary
stringlengths
1
160
author
stringlengths
2
30
certification
stringclasses
2 values
created_at
stringdate
2013-10-25 17:32:12
2025-04-12 09:38:24
updated_at
stringdate
2013-10-25 17:32:12
2025-04-12 09:38:24
hit_count
int64
0
10.6M
has_video
bool
2 classes
content
stringlengths
4
576k
upvotes
int64
0
11.5k
downvotes
int64
0
358
tags
stringlengths
2
193
comments
int64
0
2.56k
count-sorted-vowel-strings
easy peasy squeasy dp
easy-peasy-squeasy-dp-by-fr1nkenstein-l69n
well the question is entirely based on previous results as like we know 1 vowel will always make only 1 combinaation no matter how many spaces are given, so we
fr1nkenstein
NORMAL
2022-05-11T05:26:14.181192+00:00
2022-05-11T05:26:36.645213+00:00
435
false
well the question is entirely based on previous results as like we know 1 vowel will always make only 1 combinaation no matter how many spaces are given, so we initialize entire dp with 1, now n are given spaces and 5 are number for character we can use (vowels) , further i noticed n character at 1 space gives us n as...
5
0
['Dynamic Programming', 'Java']
0
count-sorted-vowel-strings
A valid solution (beats 90%), O(1) - no DP
a-valid-solution-beats-90-o1-no-dp-by-da-9voo
Beats 85% in time, and better than 90% in space.\n\nUses an advanced feature called "case-switch" to achive O(1) time & space in only 100 lines of code.\n\npubl
DanWritesCode
NORMAL
2022-05-11T02:43:31.103022+00:00
2022-05-11T02:43:31.103056+00:00
325
false
Beats 85% in time, and better than 90% in space.\n\nUses an advanced feature called "case-switch" to achive O(1) time & space in only 100 lines of code.\n\n```public class Solution {\n public int CountVowelStrings(int n) {\n switch(n) {\n case 1:\n return 5;\n case 2:\n ...
5
2
[]
2
count-sorted-vowel-strings
C++ || Easy & Simple Code || DP
c-easy-simple-code-dp-by-agrasthnaman-yr9i
\nclass Solution {\npublic:\n int countVowelStrings(int n) {\n vector<int> dp(5, 1);\n for(int i=0; i<n; i++){\n for(int j=1; j<5; j
agrasthnaman
NORMAL
2022-03-06T21:02:49.043136+00:00
2022-03-06T21:02:49.043174+00:00
216
false
```\nclass Solution {\npublic:\n int countVowelStrings(int n) {\n vector<int> dp(5, 1);\n for(int i=0; i<n; i++){\n for(int j=1; j<5; j++){dp[j] = dp[j-1] + dp[j];}\n }\n return dp[4];\n }\n};\n```\nDo upvote if it helped :)
5
0
['Dynamic Programming', 'C']
1
count-sorted-vowel-strings
Top Down Dp Runtime 1 ms Easy Solution
top-down-dp-runtime-1-ms-easy-solution-b-r4uf
\nclass Solution {\n public int countVowelStrings(int n) {\n \n int [][]dp=new int[5][n+1];\n int i,j;\n \n for(i=0;i<5;i++)\n
aadishjain__
NORMAL
2021-10-25T12:32:10.850485+00:00
2021-10-25T12:32:10.850525+00:00
80
false
```\nclass Solution {\n public int countVowelStrings(int n) {\n \n int [][]dp=new int[5][n+1];\n int i,j;\n \n for(i=0;i<5;i++)\n {\n for(j=0;j<=n;j++)\n {\n if(i==0)\n {\n dp[i][j]=1;\n ...
5
1
[]
0
count-sorted-vowel-strings
1 line simple solution EXPLAINED | C++ | 100% faster
1-line-simple-solution-explained-c-100-f-sdv5
Since the order of alphabets has to lexicographic, the relative positions of all 5 vowels is fixed. The only thing we need to find is the count of occurence of
rajat2001
NORMAL
2021-09-30T21:31:57.194099+00:00
2021-10-04T16:33:20.341282+00:00
131
false
Since the order of alphabets has to lexicographic, the relative positions of all 5 vowels is fixed. The only thing we need to find is the count of occurence of each vowel. Let us say the counts are x1,x2...,x5\nTherefore, x1+x2+x3+x4+x5 = n (All xi\'s>=0)\nThe number of ways for the above equation is (4+n)C(n) (I\'ve a...
5
0
[]
1
count-sorted-vowel-strings
100% Faster
100-faster-by-manya24-polx
Liked it? Kindly Upvote \uD83D\uDE0A\u270C\n\nn = 1 -> dp = [ 1 , 2 , 3 , 4 , 5 ]\nn = 2 -> dp = [ 1 , 3 , 6 , 10 , 15 ]\n\nclass Solution {\npublic:\n int c
manya24
NORMAL
2021-09-12T19:49:53.761850+00:00
2021-09-12T19:49:53.761901+00:00
100
false
***Liked it? Kindly Upvote*** \uD83D\uDE0A\u270C\n\n**n = 1 -> dp = [ 1 , 2 , 3 , 4 , 5 ]\nn = 2 -> dp = [ 1 , 3 , 6 , 10 , 15 ]**\n```\nclass Solution {\npublic:\n int countVowelStrings(int n)\n {\n vector<int> dp(5 , 1);\n for(int i = 0 ; i < n ; i++)\n {\n for(int j = 1 ; j < 5 ...
5
0
[]
0
count-sorted-vowel-strings
Recursion and memoization in python
recursion-and-memoization-in-python-by-d-8x9m
for 1 ; a,e,i,o,u value = 5\nfor 2: \naa, ae, ai, ao, au\n\t\t\t ee, ei, eo, eu\n\t\t\t\t\t ii, io, iu\n\t\t\t\t\t\t oo, ou\n\t\t\t\t\t\t\t
deleted_user
NORMAL
2021-04-07T10:27:02.848431+00:00
2021-04-07T10:39:24.414626+00:00
445
false
for 1 ; a,e,i,o,u value = 5\nfor 2: \naa, ae, ai, ao, au\n\t\t\t ee, ei, eo, eu\n\t\t\t\t\t ii, io, iu\n\t\t\t\t\t\t oo, ou\n\t\t\t\t\t\t\t uu \n\t\t\t\t\t\t\t value = 15\nfor 3: we can add a to all the strings in previous case so 15 will already be there.value will be (n = 2, w = 5) = 15\...
5
0
['Recursion', 'Memoization', 'Python', 'Python3']
1
count-sorted-vowel-strings
C++ code using recursion and memoization (DP) 100% faster
c-code-using-recursion-and-memoization-d-xo8u
```\nclass Solution {\npublic:\n int count(int n,int vow,vector>&dp){\n if(vow==0) return dp[n][vow] = 0;\n if(dp[n][vow] != -1)\n
yashgautam113
NORMAL
2021-03-08T19:52:23.524609+00:00
2021-03-16T11:15:46.366160+00:00
509
false
```\nclass Solution {\npublic:\n int count(int n,int vow,vector<vector<int>>&dp){\n if(vow==0) return dp[n][vow] = 0;\n if(dp[n][vow] != -1)\n return dp[n][vow];\n if(n==0) return dp[n][vow] = 1;\n dp[n][vow] = count(n,vow - 1,dp) + count(n - 1,vow,dp);\n return dp[n][v...
5
0
['Dynamic Programming', 'Recursion', 'Memoization', 'C']
0
count-sorted-vowel-strings
Java | One-line Solution | Math | O(1) and O(1)
java-one-line-solution-math-o1-and-o1-by-1vh4
Mathematical Explanation:\nThe process we count valid results can be considered as to count combinations when sampling n elements with replacement from the set
orc-dev
NORMAL
2021-01-12T03:14:38.584361+00:00
2021-01-12T03:14:38.584413+00:00
310
false
Mathematical Explanation:\nThe process we count valid results can be considered as **to count combinations when sampling *n* elements with replacement from the set** *S* = { a, e, i, o, u }. Note, we only consider the combinations of the selected elements.\n\nFor example, if n = 3, { a, a, e } and { e, a, a } are consi...
5
0
['Math', 'Java']
1
count-sorted-vowel-strings
[C++] [DP]- Simple and easy to understand solution
c-dp-simple-and-easy-to-understand-solut-oxqu
\nclass Solution {\npublic:\n \n int countVowelStrings(int n) {\n if(n==0)\n return 0;\n vector<vector<int> > dp(n+1,vector<int>
morning_coder
NORMAL
2020-11-01T04:39:36.273578+00:00
2020-11-01T05:25:58.491750+00:00
690
false
```\nclass Solution {\npublic:\n \n int countVowelStrings(int n) {\n if(n==0)\n return 0;\n vector<vector<int> > dp(n+1,vector<int> (5,0));\n //dp[i][j]=> sorted string of length i ending at vowel no j(a,e,i,o,u)\n for(int i=0;i<5;i++){\n dp[1][i]=1;\n }\n ...
5
1
['Dynamic Programming', 'C', 'C++']
0
count-sorted-vowel-strings
[Javascript] Math O(1)
javascript-math-o1-by-alanchanghsnu-3654
Choose how many vowels will be used (1~5)\n2. Get all sets of possible (k-1) converting points C(n-1, k-1) where k is the number of used vowels.\n\nSince there
alanchanghsnu
NORMAL
2020-11-01T04:01:35.141014+00:00
2020-11-01T16:12:30.318029+00:00
692
false
1. Choose how many vowels will be used (1~5)\n2. Get all sets of possible `(k-1)` converting points `C(n-1, k-1)` where `k` is the number of used vowels.\n\nSince there are 5 vowels at most, the time complexity is O(1)\n\nFor example, if given n = 6, there are 5 cases:\n\n1. Choose 1 vowel: 5 cases only;\n2. Choose 2 v...
5
0
['Math', 'JavaScript']
2
count-sorted-vowel-strings
DP detailed explanation
dp-detailed-explanation-by-bibasmall-w2f5
Intuition\n Describe your first thoughts on how to solve this problem. \nLet\'s illustrate this problem with a table. A row reflects the addition of a new lette
bibasmall
NORMAL
2024-08-22T15:56:18.228399+00:00
2024-08-22T19:06:04.916613+00:00
177
false
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nLet\'s illustrate this problem with a table. A row reflects the addition of a new letter to a set of possible letters. A column reflects the length of the string. Cells contain the number of strings with the corresponding set of letters a...
4
0
['Dynamic Programming', 'C++']
1
count-sorted-vowel-strings
One line solution | Math | O(1) | Fastest
one-line-solution-math-o1-fastest-by-bhu-m88r
Intuition\nThis is a simple math problem. Let\'s redefined as "no of ways to select N vowels where each vowel can be repeated."\n Describe your first thoughts o
bhumi_1020
NORMAL
2024-08-07T09:51:27.272846+00:00
2024-08-07T09:51:27.272872+00:00
268
false
# Intuition\nThis is a simple math problem. Let\'s redefined as "no of ways to select N vowels where each vowel can be repeated."\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\nThe formulae is (n+r-1)C r , where n = 5(number of vowels), r = N.\nSo the formulae is reduced to (4+r)C r...
4
0
['Math', 'Combinatorics', 'C++', 'Java']
0
count-sorted-vowel-strings
Pure Mathematical Solution || O(1) || Direct Formula By Observation
pure-mathematical-solution-o1-direct-for-ozi7
Observations\n /\n Let n = 1: ans = 1 + 1 + 1 + 1 + 1 = 5 \n Let n = 2: ans = 5 + 4 + 3 + 2 + 1 = 15\n Let n = 3: _ _ _ : a a _ -> 5
abhijeet5000kumar
NORMAL
2024-02-02T16:47:08.793077+00:00
2024-02-02T16:47:47.053099+00:00
440
false
# Observations\n /*\n Let n = 1: ans = 1 + 1 + 1 + 1 + 1 = 5 \n Let n = 2: ans = 5 + 4 + 3 + 2 + 1 = 15\n Let n = 3: _ _ _ : a a _ -> 5 +a e _ -> 4 .....\n a _ _ : 5+4+3+2+1 = 15\n e _ _ : 4+3+2+1 = 10\n ans = 15 + 10 + 6 + 3 + 1 = 35\n ...
4
0
['Math', 'Combinatorics', 'C++']
0
count-sorted-vowel-strings
DP : Time O(N) and Constant space
dp-time-on-and-constant-space-by-not_act-zzbf
Intuition\n Describe your first thoughts on how to solve this problem. \n \t a e i o u\n n=1 1 1 1 1 1 /a, e, i, o, u\n n=2 5 4 3
not_active
NORMAL
2023-10-15T19:32:16.193009+00:00
2023-10-15T19:32:16.193037+00:00
213
false
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n \t a e i o u\n n=1 1 1 1 1 1 /a, e, i, o, u\n n=2 5 4 3 2 1 /a-> aa,ae,ai,ao,au | e-> ee,ei,eo,eu | i-> ii,io,iu | o-> oo,ou | u-> uu\n n=3 15 10 6 3 1\n\n Logic: \n in n=3, e will be ((p...
4
0
['C++']
1
count-sorted-vowel-strings
BEATS 100% in time | 80% in Space complexity | C++ | Precise
beats-100-in-time-80-in-space-complexity-i808
Code\n\nclass Solution {\n int t[6][51];\n int solve(int i, int n, int k){\n if(k==0){\n return 1;\n }\n if(i==
kr_vishnu
NORMAL
2023-01-19T14:31:51.986306+00:00
2023-01-19T14:31:51.986353+00:00
769
false
# Code\n```\nclass Solution {\n int t[6][51];\n int solve(int i, int n, int k){\n if(k==0){\n return 1;\n }\n if(i==n){\n return 0;\n }\n if(t[i][k] != -1){\n return t[i][k];\n }\n int cnt1=solve(i,n,k-1);\n in...
4
0
['C++']
0
count-sorted-vowel-strings
O(n) | Runtime: 0 ms, faster than 100.00% | Intuition Explained
on-runtime-0-ms-faster-than-10000-intuit-p6dv
Appraoch 1 \n\nIntution : At First glance it is easy to understand that this is backtracking related question. All we have to do is count all the combination th
prashank123
NORMAL
2022-05-11T17:27:26.526081+00:00
2022-05-11T18:18:42.537466+00:00
577
false
**Appraoch 1 **\n\nIntution : At First glance it is easy to understand that this is backtracking related question. All we have to do is count all the combination that can generate string of length n and will be of sorted order.\n\nIf we go with backtracking the time complexity will be 2^n. **(OH MY GOD)**. It is too sl...
4
1
['Backtracking', 'Prefix Sum']
0
count-sorted-vowel-strings
JAVA Backtracking || Worst Case but better understanding
java-backtracking-worst-case-but-better-l45om
\n`class Solution {\n int totalcount = 0;\n public int countVowelStrings(int n) {\n char[]arr = new char[]{\'a\' , \'e\' , \'i\' , \'o\' , \'u\'};\
banerjeeshibashis01
NORMAL
2022-05-11T13:40:47.639253+00:00
2022-05-31T09:50:48.398379+00:00
55
false
```\n`class Solution {\n int totalcount = 0;\n public int countVowelStrings(int n) {\n char[]arr = new char[]{\'a\' , \'e\' , \'i\' , \'o\' , \'u\'};\n dfs(arr , 0 , 0 , n);\n return totalcount;\n }\n public void dfs(char[]arr , int start , int count , int size){\n if(count == si...
4
0
['Java']
1
count-sorted-vowel-strings
[Python] The easiest one with MAD SKILLZ Paint explanation
python-the-easiest-one-with-mad-skillz-p-5b3g
\n\n\tclass Solution:\n\t\tdef countVowelStrings(self, n: int) -> int:\n\t\t\tvowels = deque([5,4,3,2,1])\n\t\t\tsm = temp = sum(vowels)\n\t\t\tfor i in range(1
Cuno_DNFC
NORMAL
2022-05-11T11:40:05.944200+00:00
2022-05-11T11:40:05.944252+00:00
260
false
![image](https://assets.leetcode.com/users/images/4e09b616-ca35-4732-b657-22235cb2d810_1652269151.3420324.png)\n\n\tclass Solution:\n\t\tdef countVowelStrings(self, n: int) -> int:\n\t\t\tvowels = deque([5,4,3,2,1])\n\t\t\tsm = temp = sum(vowels)\n\t\t\tfor i in range(1, n):\n\t\t\t\tfor _ in range(5):\n\t\t\t\t\tvowel...
4
0
['Queue', 'Python']
0
count-sorted-vowel-strings
Simple Solution || Recursion || Memoization || Tabular Dynamic Programming
simple-solution-recursion-memoization-ta-m0i0
Recursion || Memoization || Tabular Dynamic Programming\n\nRecursion:\n\nThought Process:\n1. Pick an element in repeated times.\n2. Don\'t pick the element.\n
sanheen-sethi
NORMAL
2022-05-11T09:40:23.080902+00:00
2022-05-11T15:29:39.338931+00:00
331
false
### Recursion || Memoization || Tabular Dynamic Programming\n\n**Recursion:**\n\n*Thought Process:*\n1. Pick an element in repeated times.\n2. Don\'t pick the element.\n(Same thought of `unbounded knapsack` or `combination sum I` problem)\n\n> **Void Recursion:**\n\n```\nclass Solution {\npublic:\n \n void calcu...
4
0
['Dynamic Programming', 'Backtracking', 'Recursion', 'Memoization']
0
count-sorted-vowel-strings
Simple Solution || Easy Understanding
simple-solution-easy-understanding-by-12-3s5p
\n//Please do upvote, if you like my solution :)\nclass Solution {\npublic:\n int ans = 0;\n void solve(int n,vector<char> &v,int idx){\n if(n == 0
123_tripathi
NORMAL
2022-05-11T04:08:40.568367+00:00
2022-06-01T10:21:35.003653+00:00
435
false
```\n//Please do upvote, if you like my solution :)\nclass Solution {\npublic:\n int ans = 0;\n void solve(int n,vector<char> &v,int idx){\n if(n == 0){\n ans++;\n return;\n }\n if(idx >= v.size()) return;\n solve(n-1,v,idx);\n solve(n,v,idx+1);\n }\n ...
4
0
['Backtracking', 'Recursion', 'C', 'C++']
1
count-sorted-vowel-strings
[C++] Simplest Approach, Pattern recognizing and Efficient O(n). ✅
c-simplest-approach-pattern-recognizing-dywh7
Question:\n\nGiven an integer n, return the number of strings of length n that consist only of vowels (a, e, i, o, u) and are lexicographically sorted.\n\nA str
ShriyanshAgarwal
NORMAL
2022-05-11T03:42:27.407998+00:00
2022-05-11T03:42:27.408054+00:00
354
false
**Question:**\n```\nGiven an integer n, return the number of strings of length n that consist only of vowels (a, e, i, o, u) and are lexicographically sorted.\n\nA string s is lexicographically sorted if for all valid i, s[i] is the same as or comes before s[i+1] in the alphabet.\n```\n* Before jumping to answering the...
4
0
['C', 'C++']
2
count-sorted-vowel-strings
|| UNBOUNDED KNAPSACK|| pattern
unbounded-knapsack-pattern-by-badal_jha-tew6
I observed that we can convert this problem in unbounded knapsack by converting [a,e,i,o,u] into [1,1,1,1,1] . Now it became standard subset sum problem we have
Badal_Jha
NORMAL
2022-02-03T21:04:11.776570+00:00
2022-02-03T21:08:03.523988+00:00
110
false
**I observed that we can convert this problem in unbounded knapsack by converting [a,e,i,o,u] into [1,1,1,1,1] . Now it became standard subset sum problem we have to find number of subset with subset sum=n and we can pick one element more than once**\n\n**this is my first post so please upvote if You like it**\n```\nin...
4
0
['Dynamic Programming']
0
count-sorted-vowel-strings
[C++} Easy to understand Time : O(N) & Space : O(1)
c-easy-to-understand-time-on-space-o1-by-xorf
\nclass Solution\n{\npublic:\n int countVowelStrings(int n)\n {\n int a = 1, e = 1, i = 1, o = 1, u = 1;\n for (int N = 2; N <= n; N++)\n
jayesh2604
NORMAL
2021-10-13T07:17:43.282542+00:00
2021-10-13T07:17:43.282590+00:00
116
false
```\nclass Solution\n{\npublic:\n int countVowelStrings(int n)\n {\n int a = 1, e = 1, i = 1, o = 1, u = 1;\n for (int N = 2; N <= n; N++)\n {\n u = a + e + i + o + u;\n o = a + e + i + o;\n i = a + e + i;\n e = a + e;\n a = a;\n }...
4
1
[]
2
count-sorted-vowel-strings
O(1) Time | O(1) Space - Discrete Math
o1-time-o1-space-discrete-math-by-daymon-7e21
Given that we have a sorted combinations problem, with respect to permutations, we can apply the Combinations With Repetitions formula:\n\n\n\nWhere n is our ob
daymon-
NORMAL
2021-07-23T19:38:20.583566+00:00
2021-07-23T19:38:20.583617+00:00
155
false
Given that we have a sorted combinations problem, with respect to permutations, we can apply the *Combinations With Repetitions* formula:\n\n![image](https://assets.leetcode.com/users/images/b85a59ce-2ba5-4b5b-84ee-4bad83b4258d_1627068909.2655072.png)\n\nWhere n is our object (chars) and k is our repetition (4 vowels)\...
4
0
[]
0
count-sorted-vowel-strings
Simple and concise C++ solution||With Explanation||100% faster
simple-and-concise-c-solutionwith-explan-q2ry
If you really found my solution helpful please upvote it, as it motivates me to post such kind of codes and help the coding community, if you have some queries
anubhavbaner7
NORMAL
2021-07-02T07:53:42.557179+00:00
2021-07-02T07:53:42.557218+00:00
175
false
**If you really found my solution helpful please upvote it, as it motivates me to post such kind of codes and help the coding community, if you have some queries or some improvements please feel free to comment and share your views.**\nTry to observe the pattern.\nNote: Here the element present at each index represents...
4
0
['Dynamic Programming', 'C', 'C++']
0
count-sorted-vowel-strings
C++ solution with explanation | Two methods with full explanation
c-solution-with-explanation-two-methods-hqllg
Method 1 - (Using Backtracking)\n\nSolution Idea: \n1. We first create a vector storing all the vowels present in English alphabets.\n2. We the create a functio
baibhabwb007
NORMAL
2021-02-02T15:37:32.540158+00:00
2021-02-02T18:05:09.386873+00:00
131
false
***Method 1 - (Using Backtracking)***\n\nSolution Idea: \n1. We first create a vector storing all the vowels present in English alphabets.\n2. We the create a function called *helper* which contains the backtracking algo.\n3. The code has been further commented in each part, for better understanding.\n\n```\nclass Solu...
4
0
[]
0
count-sorted-vowel-strings
The method to obtain the answer of (n + 1)(n + 2)(n + 3)(n + 4) / 24
the-method-to-obtain-the-answer-of-n-1n-sw3co
As we know, when n = 1, the answer = 5 that is 1 + 1 + 1 + 1 + 1;\nwhen n = 2, the answer = 15 that is 1 + 2 + 3 + 4 + 5\n n = 3, the answer = 35, that
yaody1982
NORMAL
2020-12-14T08:11:04.131407+00:00
2020-12-14T08:11:04.131464+00:00
132
false
As we know, when n = 1, the answer = 5 that is 1 + 1 + 1 + 1 + 1;\nwhen n = 2, the answer = 15 that is 1 + 2 + 3 + 4 + 5\n n = 3, the answer = 35, that is 1 + 3 + 6 + 10 + 15\n\t\t ....\n\t\t we can set the f(n) = fn(1) + fn(2) + fn(3) + fn(4) + fn(5)\n\t\t fn(1) = 1; \n\t\t fn(2) = 1 + fn-1(2), so fn(2) = 1+1+...
4
0
[]
1
ambiguous-coordinates
[C++/Java/Python] Solution with Explanation
cjavapython-solution-with-explanation-by-zlto
We can split S to two parts for two coordinates.\nThen we use sub function f to find all possible strings for each coordinate.\n\nIn sub functon f(S)\nif S == "
lee215
NORMAL
2018-04-15T03:10:03.850563+00:00
2018-10-22T06:48:30.673361+00:00
10,557
false
We can split S to two parts for two coordinates.\nThen we use sub function ```f``` to find all possible strings for each coordinate.\n\n**In sub functon f(S)**\nif S == "": return []\nif S == "0": return [S]\nif S == "0XXX0": return []\nif S == "0XXX": return ["0.XXX"]\nif S == "XXX0": return [S]\nreturn [S, "X.XXX", "...
156
4
[]
10
ambiguous-coordinates
Really clear Java code
really-clear-java-code-by-wangzi6147-5fuk
\nclass Solution {\n public List<String> ambiguousCoordinates(String S) {\n S = S.substring(1, S.length() - 1);\n List<String> result = new Lin
wangzi6147
NORMAL
2018-04-15T03:39:01.574018+00:00
2018-08-10T08:30:40.536688+00:00
2,939
false
```\nclass Solution {\n public List<String> ambiguousCoordinates(String S) {\n S = S.substring(1, S.length() - 1);\n List<String> result = new LinkedList<>();\n for (int i = 1; i < S.length(); i++) {\n List<String> left = allowed(S.substring(0, i));\n List<String> right = a...
60
2
[]
7
ambiguous-coordinates
C++ Clean and Simple Solution Faster Than 96%
c-clean-and-simple-solution-faster-than-vqnum
\nclass Solution {\npublic:\n vector<string> ambiguousCoordinates(string s) {\n vector<string> res;\n string s2 = s.substr(1, s.size()-2);\n
yehudisk
NORMAL
2021-05-13T07:33:31.396723+00:00
2021-05-13T07:33:31.396757+00:00
2,219
false
```\nclass Solution {\npublic:\n vector<string> ambiguousCoordinates(string s) {\n vector<string> res;\n string s2 = s.substr(1, s.size()-2);\n int n = s2.size();\n \n for (int i = 1; i < n; i++) {\n vector<string> first = getNumbers(s2.substr(0, i));\n vector...
50
6
['C']
1
ambiguous-coordinates
Concise C++ solution with comments
concise-c-solution-with-comments-by-mzch-7yqt
\nvector<string> cases(string &&s) {\n if (s.size() == 1) // single digit\n return {s};\n if (s.front() == \'0\') { // 0xxx\n if (s.back() =
mzchen
NORMAL
2018-04-15T03:52:48.639367+00:00
2018-09-06T00:30:46.019214+00:00
1,738
false
```\nvector<string> cases(string &&s) {\n if (s.size() == 1) // single digit\n return {s};\n if (s.front() == \'0\') { // 0xxx\n if (s.back() == \'0\') // 0xxx0\n return {};\n return {"0." + s.substr(1)}; // 0xxx9\n }\n if (s.back() == \'0\') // 9xxx0\n return {s};\n ...
32
1
[]
2
ambiguous-coordinates
[Python] product solution with correct complexity, explained
python-product-solution-with-correct-com-4851
Let us create function generate(s), which generate all possible candidates for string s: we need to check number without dot and also all possible ways to put d
dbabichev
NORMAL
2021-05-13T09:18:56.685439+00:00
2021-05-13T09:18:56.685467+00:00
1,298
false
Let us create function `generate(s)`, which generate all possible candidates for string `s`: we need to check number without dot and also all possible ways to put dot inside. We need to check the condition `our original representation never had extraneous zeroes`, so we check that if some number starts with `0`, it sho...
29
2
[]
2
ambiguous-coordinates
JS, Python, Java, C++ | Easy Iterative Solution w/ Explanation
js-python-java-c-easy-iterative-solution-dr9r
(Note: This is part of a series of Leetcode solution explanations. If you like this solution or find it useful, please upvote this post.)\n\n---\n\n#### Idea:\n
sgallivan
NORMAL
2021-05-13T12:06:12.270810+00:00
2021-05-14T00:11:37.859663+00:00
1,320
false
*(Note: This is part of a series of Leetcode solution explanations. If you like this solution or find it useful,* ***please upvote*** *this post.)*\n\n---\n\n#### ***Idea:***\n\nFor this problem, we have two basic challenges. The first challenge is preventing invalid coordinates. For that, we can define a helper functi...
27
8
['C', 'Python', 'Java', 'JavaScript']
1
ambiguous-coordinates
Ambiguous Coordinates | JS, Python, Java, C++ | Easy Iterative Solution w/ Explanation
ambiguous-coordinates-js-python-java-c-e-2g42
(Note: This is part of a series of Leetcode solution explanations. If you like this solution or find it useful, please upvote this post.)\n\n---\n\n#### Idea:\n
sgallivan
NORMAL
2021-05-13T12:07:00.729202+00:00
2021-05-14T00:12:39.058808+00:00
923
false
*(Note: This is part of a series of Leetcode solution explanations. If you like this solution or find it useful,* ***please upvote*** *this post.)*\n\n---\n\n#### ***Idea:***\n\nFor this problem, we have two basic challenges. The first challenge is preventing invalid coordinates. For that, we can define a helper functi...
23
9
[]
0
ambiguous-coordinates
[Python3] valid numbers
python3-valid-numbers-by-ye15-4zr7
Algo\nThe key is to deal with extraneous zeros. Below rule gives the what\'s required\n1) if a string has length 1, return it;\n2) if a string with length large
ye15
NORMAL
2020-11-13T20:39:43.531125+00:00
2021-05-13T16:01:51.253894+00:00
831
false
Algo\nThe key is to deal with extraneous zeros. Below rule gives the what\'s required\n1) if a string has length 1, return it;\n2) if a string with length larger than 1 and starts and ends with 0, it cannot contain valid number;\n3) if a string starts with 0, return `0.xxx`;\n4) if a string ends with 0, return `xxx0`;\...
14
0
['Python3']
2
ambiguous-coordinates
C++ modular code with explanation
c-modular-code-with-explanation-by-ohmah-zv6i
The logic is quite simple for this problem. You have to break the strings, at all possible points. Then you have to again break all the formed substrings, by pl
ohmahgawd
NORMAL
2020-04-27T11:08:51.692228+00:00
2020-05-30T11:06:48.301331+00:00
748
false
The logic is quite simple for this problem. You have to break the strings, at all possible points. Then you have to again break all the formed substrings, by placing dots in between the substrings, and following the `0` rules.\n\nExample - `(1234)`\n\nAfter removing the brackets, we get `s = 1234`. If you break the str...
11
0
['String', 'C++']
1
ambiguous-coordinates
Rust: 0-4ms, 100% Runtime - Iterative Solution
rust-0-4ms-100-runtime-iterative-solutio-iuz9
rust\nimpl Solution {\n pub fn ambiguous_coordinates(s: String) -> Vec<String> {\n let s = &s.as_bytes()[1..s.len() - 1]; // ignore the parenthesis ar
seandewar
NORMAL
2021-05-13T08:49:17.860628+00:00
2021-05-13T09:35:44.283585+00:00
248
false
```rust\nimpl Solution {\n pub fn ambiguous_coordinates(s: String) -> Vec<String> {\n let s = &s.as_bytes()[1..s.len() - 1]; // ignore the parenthesis around the coords\n (1..s.len()).fold(vec![], |mut acc, commai| {\n let (x, y) = s.split_at(commai);\n (0..x.len())\n ...
6
1
['Iterator', 'Rust']
0
ambiguous-coordinates
Kotlin best Soltuion | like
kotlin-best-soltuion-like-by-progp-lgeh
\n# Code\n\nclass Solution {\n private fun leadingZeros(v: String): Int {\n var leadingZeros = 0\n while(leadingZeros < v.length && v[leadingZe
progp
NORMAL
2023-12-10T07:43:30.513285+00:00
2023-12-10T07:43:30.513316+00:00
50
false
\n# Code\n```\nclass Solution {\n private fun leadingZeros(v: String): Int {\n var leadingZeros = 0\n while(leadingZeros < v.length && v[leadingZeros] == \'0\') leadingZeros++\n return leadingZeros\n }\n private fun tailingZeros(v: String): Int {\n var tailingZeros = 0\n whil...
4
0
['Kotlin']
0
ambiguous-coordinates
Java Simple and easy to understand solution, 8 ms, faster than 79.79%, clean code with comments
java-simple-and-easy-to-understand-solut-ffm1
PLEASE UPVOTE IF YOU LIKE THIS SOLUTION\n\n\n\nclass Solution {\n public List<String> ambiguousCoordinates(String s) {\n \n String digits = s.s
satyaDcoder
NORMAL
2021-05-14T03:58:12.691001+00:00
2021-05-14T03:58:12.691038+00:00
478
false
**PLEASE UPVOTE IF YOU LIKE THIS SOLUTION**\n\n\n```\nclass Solution {\n public List<String> ambiguousCoordinates(String s) {\n \n String digits = s.substring(1, s.length() - 1);\n \n List<String> result = new ArrayList();\n if(digits.length() < 2) return result;\n \n ...
4
0
['Java']
1
ambiguous-coordinates
PYTHON || Well-explained || 97.33% faster || Easy-understanding ||
python-well-explained-9733-faster-easy-u-9uka
Idea :\nSplit the string into left and right , then create the possible string seperately , then merge .\n\n When there is only one letter in the string , direc
abhi9Rai
NORMAL
2021-05-13T10:12:10.851221+00:00
2021-05-13T10:12:10.851250+00:00
265
false
## **Idea :**\nSplit the string into left and right , then create the possible string seperately , then merge .\n\n* When there is only one letter in the string , directly return itself.\n* when the first and last letter is \'0\', then it\'s impossible to create a valid string, return []\n* when the first letter is \'0...
3
1
['Math', 'Python']
2
ambiguous-coordinates
Modular programming easy to read C++
modular-programming-easy-to-read-c-by-ic-3vwf
\nclass Solution {\npublic:\n vector<string> ambiguousCoordinates(string s) {\n s = s.substr(1, s.length() - 2);\n vector<string> result;\n
icfy
NORMAL
2021-05-13T07:54:24.608843+00:00
2021-05-13T07:54:24.608887+00:00
209
false
```\nclass Solution {\npublic:\n vector<string> ambiguousCoordinates(string s) {\n s = s.substr(1, s.length() - 2);\n vector<string> result;\n for (int i = 1; i < s.length(); i++)\n {\n string str1 = s.substr(0, i), str2 = s.substr(i);\n vector<string> res1 = genVali...
3
1
[]
1
ambiguous-coordinates
[Python] Generate. Beats 94% runtime and 91% memory
python-generate-beats-94-runtime-and-91-5xp7k
For a string slice, we generate a list of numbers with following rules:\n1. If the slice is \'0\', then return [\'0\']\n2. If the slice starts and ends with \'0
watashij
NORMAL
2021-10-09T19:26:21.605541+00:00
2021-10-09T19:26:21.605568+00:00
152
false
For a string slice, we generate a list of numbers with following rules:\n1. If the slice is `\'0\'`, then return `[\'0\']`\n2. If the slice starts and ends with `\'0\'`, we generate nothing. Because we cannot have `0.****0`\n3. If the slice starts with `\'0\'`, then the only number we generate is `0.****`\n4. If the sl...
2
0
[]
0
ambiguous-coordinates
Java | Simple split and apply dots approach | Beats 80% | With explaination
java-simple-split-and-apply-dots-approac-1vjf
Key Intuition: \n1. Split the string up in 2 parts in all possible ways. \n2. Now add dots at various possible places in each split part. Remember to skip insta
towr
NORMAL
2021-05-13T16:57:51.792713+00:00
2021-05-13T16:57:51.792761+00:00
256
false
Key Intuition: \n1. Split the string up in 2 parts in all possible ways. \n2. Now add dots at various possible places in each split part. Remember to skip instances where pre dot part has leading zeros and post dot part has trailing zeros. Also do not forget to include the complete string itself without the dot in case...
2
0
[]
2
ambiguous-coordinates
C++ Solution || 95% faster
c-solution-95-faster-by-kannu_priya-oysv
\nclass Solution {\npublic:\n vector<string> ambiguousCoordinates(string s) {\n int n = s.size();\n vector<string>ans;\n for(int i = 1;
kannu_priya
NORMAL
2021-05-13T16:35:19.225726+00:00
2021-06-04T16:57:38.259297+00:00
201
false
```\nclass Solution {\npublic:\n vector<string> ambiguousCoordinates(string s) {\n int n = s.size();\n vector<string>ans;\n for(int i = 1; i < n-2; i++){\n vector<string>A = helper(s.substr(1, i));\n vector<string>B = helper(s.substr(i+1, n-2-i));\n for(auto &a :...
2
1
['C', 'C++']
0
ambiguous-coordinates
Explained Algorithm | C++ clean code
explained-algorithm-c-clean-code-by-morn-m2n0
Intuition:\n1. Need to divide string in two halves and place decimal properly in each half.\n2. Broke the string in two halves and made valid combination list o
morning_coder
NORMAL
2021-05-13T10:04:24.663834+00:00
2021-05-13T11:28:58.192356+00:00
200
false
**Intuition:**\n1. Need to divide string in two halves and place decimal properly in each half.\n2. Broke the string in two halves and made valid combination list of each half. \n3. Received two list from left half and right half - assuming size a and b respectively\n4. Now simple make (a* b) combinations of all elemen...
2
1
['C', 'C++']
1
ambiguous-coordinates
C++ Solution with some comments
c-solution-with-some-comments-by-shtanri-2zko
\nclass Solution {\npublic:\n vector<string> ambiguousCoordinates(string S) {\n // First get rid of paranthesis at the both end\n S.erase(0, 1)
shtanriverdi
NORMAL
2021-03-18T16:49:54.326199+00:00
2021-03-18T16:49:54.326242+00:00
244
false
```\nclass Solution {\npublic:\n vector<string> ambiguousCoordinates(string S) {\n // First get rid of paranthesis at the both end\n S.erase(0, 1);\n S.pop_back();\n vector<string> result;\n vector<pair<string, string>> valids;\n int size = S.size();\n // Without dots...
2
0
['C']
0
ambiguous-coordinates
JavaScript 100% with comments
javascript-100-with-comments-by-mamatela-2zhl
\nfunction solution(S) {\n S = S.slice(1, S.length - 1);\n let arr = [];\n\n // Separate in 2 parts. All possible ways (just put comma in all possible
mamatela
NORMAL
2020-09-23T20:44:57.616091+00:00
2020-09-23T20:44:57.616121+00:00
139
false
```\nfunction solution(S) {\n S = S.slice(1, S.length - 1);\n let arr = [];\n\n // Separate in 2 parts. All possible ways (just put comma in all possible places).\n for (let i = 1; i < S.length; i++) {\n // get all possible (distinct) numbers that a string can be converted to. Do this for string1 and...
2
0
[]
0
ambiguous-coordinates
Simple C++ solution
simple-c-solution-by-caspar-chen-hku-xwh1
\nclass Solution {\npublic:\n bool check(string s, bool issecword){\n int n=s.length();\n\t\t// Logic explained above\n if(issecword){\n
caspar-chen-hku
NORMAL
2020-05-20T09:43:24.018986+00:00
2020-05-20T09:43:24.019020+00:00
218
false
```\nclass Solution {\npublic:\n bool check(string s, bool issecword){\n int n=s.length();\n\t\t// Logic explained above\n if(issecword){\n if(n>0 && s[n-1]==\'0\') return false;\n }\n else{\n if(n>1 && s[0]==\'0\') return false;\n }\n return true;\n ...
2
0
[]
1
ambiguous-coordinates
Accepted C# Solution
accepted-c-solution-by-maxpushkarev-1h4f
\n public class Solution\n {\n public IList<string> AmbiguousCoordinates(string s)\n {\n s = s.Substring(1, s.Length - 2);\n
maxpushkarev
NORMAL
2020-02-13T05:14:51.796759+00:00
2020-02-13T05:14:51.796809+00:00
147
false
```\n public class Solution\n {\n public IList<string> AmbiguousCoordinates(string s)\n {\n s = s.Substring(1, s.Length - 2);\n IList<string> res = new List<string>();\n for (int i = 1; i < s.Length; i++)\n {\n var left = s.Substring(0, i);\...
2
0
[]
0
ambiguous-coordinates
[Java] Super Clear Solution
java-super-clear-solution-by-ophunter-b5he
\nclass Solution {\n private List<String> sub(String s) {\n if (s.length() == 1) return Collections.singletonList(s);\n\n List<String> ans = ne
ophunter
NORMAL
2019-07-05T07:31:20.113108+00:00
2019-07-05T07:31:20.113140+00:00
228
false
```\nclass Solution {\n private List<String> sub(String s) {\n if (s.length() == 1) return Collections.singletonList(s);\n\n List<String> ans = new ArrayList<>();\n if (s.charAt(0) != \'0\') {\n ans.add(s);\n for (int i = 1; i < s.length() && !s.endsWith("0"); i++) {\n ...
2
0
[]
0
ambiguous-coordinates
neat python3 solution
neat-python3-solution-by-yecye-6ny8
\nclass Solution:\n def ambiguousCoordinates(self, S):\n """\n :type S: str\n :rtype: List[str]\n """\n \n def str2
yecye
NORMAL
2018-04-15T04:37:57.305945+00:00
2018-10-08T17:41:19.203925+00:00
196
false
```\nclass Solution:\n def ambiguousCoordinates(self, S):\n """\n :type S: str\n :rtype: List[str]\n """\n \n def str2digits(s):\n if s == \'0\':\n return [\'0\']\n if s.startswith(\'0\') and s.endswith(\'0\'):\n return []\...
2
2
[]
0
ambiguous-coordinates
Easy C++ Solution
easy-c-solution-by-farhanc-1nap
\n\n# Code\n\nclass Solution {\npublic:\n vector<string>res;\n vector<string>putdot(string s){\n vector<string>temp;\n temp.push_back(s);\n
farhanc
NORMAL
2024-01-07T11:43:37.258111+00:00
2024-01-07T11:43:37.258135+00:00
181
false
\n\n# Code\n```\nclass Solution {\npublic:\n vector<string>res;\n vector<string>putdot(string s){\n vector<string>temp;\n temp.push_back(s);\n for(int i=1;i<s.length();i++){\n temp.push_back(s.substr(0,i)+"."+s.substr(i));\n }\n return temp;\n }\n bool isValid(string s) {\n...
1
0
['C++']
0
ambiguous-coordinates
Solution
solution-by-deleted_user-1nme
C++ []\nclass Solution {\npublic:\n vector<string> ambiguousCoordinates(string s) {\n string cur1 = "";\n string cur2 = "";\n vector<str
deleted_user
NORMAL
2023-05-02T13:24:51.293180+00:00
2023-05-02T14:10:20.097991+00:00
524
false
```C++ []\nclass Solution {\npublic:\n vector<string> ambiguousCoordinates(string s) {\n string cur1 = "";\n string cur2 = "";\n vector<string> res;\n bool confirmedFirstPart = false;\n bool usedDot = false;\n backtrack(s, cur1, cur2, res, 0, confirmedFirstPart, usedDot);\n ...
1
0
['C++', 'Java', 'Python3']
1
ambiguous-coordinates
c# : Easy Solution
c-easy-solution-by-rahul89798-jp8u
\tpublic class Solution\n\t{\n\t\tList ans;\n\t\tpublic IList AmbiguousCoordinates(string s)\n\t\t{\n\t\t\tans = new List();\n\t\t\tSolve(s, new List(), 1);\n\n
rahul89798
NORMAL
2021-12-20T05:49:01.702766+00:00
2021-12-20T05:49:01.702808+00:00
108
false
\tpublic class Solution\n\t{\n\t\tList<string> ans;\n\t\tpublic IList<string> AmbiguousCoordinates(string s)\n\t\t{\n\t\t\tans = new List<string>();\n\t\t\tSolve(s, new List<string>(), 1);\n\n\t\t\treturn ans;\n\t\t}\n\n\t\tprivate void Solve(string s, List<string> str, int idx)\n\t\t{\n\t\t\tif(str.Count >= 2)\n\t\t\t...
1
0
['Backtracking']
0
ambiguous-coordinates
C++ Solution
c-solution-by-simplestman-yzo4
\nclass Solution {\npublic:\n int len;\n vector<string>ans;\n string helper(string s,int k){\n if(s.size() == 1) return s;\n if(k>=2){\n
SimplestMan
NORMAL
2021-08-26T13:55:53.965355+00:00
2021-08-26T13:55:53.965386+00:00
115
false
```\nclass Solution {\npublic:\n int len;\n vector<string>ans;\n string helper(string s,int k){\n if(s.size() == 1) return s;\n if(k>=2){\n if(s[0] == \'0\') return "-1";\n }\n if(s[s.size()-1] == \'0\'){\n if(k != s.size()) return "-1";\n }\n if(...
1
0
[]
0
ambiguous-coordinates
C++ Solution with explanation
c-solution-with-explanation-by-rmallela0-cxa1
\n /*\n * input: "(123)"\n * First we will assign commas\n * 123\n * |\n * ----------\n *
rmallela0426
NORMAL
2021-06-04T05:38:10.881680+00:00
2021-06-04T05:45:58.683756+00:00
268
false
```\n /*\n * input: "(123)"\n * First we will assign commas\n * 123\n * |\n * ----------\n * | |\n * 1, 23 12, 3\n *\n * Now we have 2 pairs after putting comma. Now try tp put the \n * decimal point\n ...
1
0
[]
0
ambiguous-coordinates
Bhayank code h bhai! C++
bhayank-code-h-bhai-c-by-aaditya-pal-t00t
c++\nclass Solution {\npublic:\n bool valpre(string &s){\n if(s.size()==1) return true;\n if(s[0]==\'0\') return false;\n return true;\n
aaditya-pal
NORMAL
2021-06-03T16:41:34.458230+00:00
2021-06-03T16:41:34.458267+00:00
158
false
```c++\nclass Solution {\npublic:\n bool valpre(string &s){\n if(s.size()==1) return true;\n if(s[0]==\'0\') return false;\n return true;\n }\n bool valsuff(string &s){\n if(s[s.size()-1]==\'0\') return false;\n return true;\n }\n bool isvalid(string &s){\n if(s....
1
0
[]
0
ambiguous-coordinates
c++ cartesian product (faster than 100%)
c-cartesian-product-faster-than-100-by-_-kn99
\nclass Solution {\nprivate:\n bool Prefix(string s)\n {\n int n=(int)s.length();\n if(n==1) return true;\n if(s[0]==\'0\') return fa
_Akansh
NORMAL
2021-05-14T21:25:32.446506+00:00
2021-05-14T21:25:48.534494+00:00
306
false
```\nclass Solution {\nprivate:\n bool Prefix(string s)\n {\n int n=(int)s.length();\n if(n==1) return true;\n if(s[0]==\'0\') return false;\n return true;\n }\n bool Suffix(string s)\n {\n int n=(int)s.length();\n if(s[n-1]==\'0\') return false;\n return ...
1
0
['C']
0
ambiguous-coordinates
swift solution with explanation
swift-solution-with-explanation-by-codea-pz18
\nclass Solution {\n func ambiguousCoordinates(_ s: String) -> [String] {\n var str = Array(s)\n str.removeFirst()\n str.removeLast()\n
codeawhile
NORMAL
2021-05-14T09:30:24.532833+00:00
2021-05-14T09:30:24.532864+00:00
156
false
```\nclass Solution {\n func ambiguousCoordinates(_ s: String) -> [String] {\n var str = Array(s)\n str.removeFirst()\n str.removeLast()\n var ans: [String] = []\n var lefts: [String] = []\n var rights: [String] = []\n for i in 0..<str.count-1 {\n lefts = m...
1
0
['Swift']
0
ambiguous-coordinates
[C++, Explanation, Easy to Understand with Comments]
c-explanation-easy-to-understand-with-co-y29u
First, we process the input string to remove the ( and ) characters at the beginning and end respectively. Now, we can place commas at n-1 positions, where n is
programmer1234
NORMAL
2021-05-14T04:50:51.463752+00:00
2021-05-14T04:53:24.796346+00:00
49
false
First, we process the input string to remove the `(` and `)` characters at the beginning and end respectively. Now, we can place commas at `n-1` positions, where `n` is the length of the processed string. For each of these cases, we divide the string into left and right subparts. For each subpart, we place a decimal po...
1
1
['C++']
0
ambiguous-coordinates
[Java] 100% 2ms Fast, Simple, Explanation
java-100-2ms-fast-simple-explanation-by-y8bqj
This code runs in 2ms or sometimes 3ms.\n\nThe execution speed comes from converting the original String to a char[] array, then do all the testing and building
dudeandcat
NORMAL
2021-05-14T01:19:38.430240+00:00
2021-05-15T06:54:00.471720+00:00
214
false
This code runs in 2ms or sometimes 3ms.\n\nThe execution speed comes from converting the original `String` to a `char[]` array, then do all the testing and building of any valid coordinate strings directly from the `char[]` array, without any slow substring creation. The code works with comma and any decimal point pos...
1
0
['Java']
0
ambiguous-coordinates
Easy clean Go solution. Beats 100%
easy-clean-go-solution-beats-100-by-evle-q62b
\nfunc ambiguousCoordinates(s string) []string {\n\tvar result []string\n\n\tfor i := 2; i <= len(s)-2; i++ {\n\t\tleft, right := s[1:i], s[i:len(s)-1]\n\n\t\ti
evleria
NORMAL
2021-05-13T20:21:31.582578+00:00
2021-05-13T20:21:31.582626+00:00
137
false
```\nfunc ambiguousCoordinates(s string) []string {\n\tvar result []string\n\n\tfor i := 2; i <= len(s)-2; i++ {\n\t\tleft, right := s[1:i], s[i:len(s)-1]\n\n\t\tif isLegalPart(left) && isLegalPart(right) {\n\t\t\tleftPartitions, rightPartitions := getAllPartitions(left), getAllPartitions(right)\n\n\t\t\tfor _, leftPar...
1
0
['Go']
0
ambiguous-coordinates
70 % :: Python
70-python-by-tuhinnn_py-06ey
\nclass Solution:\n def putDecimal(self, num):\n ans = []\n if not int(num):\n if len(num) == 1:\n return [\'0\']\n
tuhinnn_py
NORMAL
2021-05-13T18:01:24.500921+00:00
2021-05-13T18:01:24.500976+00:00
52
false
```\nclass Solution:\n def putDecimal(self, num):\n ans = []\n if not int(num):\n if len(num) == 1:\n return [\'0\']\n else:\n return []\n \n if num.startswith(\'0\'):\n return [\'0.\' + num[1:]] if not num.endswith(\'0\')...
1
0
[]
0
ambiguous-coordinates
Rust solution
rust-solution-by-sugyan-c98h
rust\nimpl Solution {\n pub fn ambiguous_coordinates(s: String) -> Vec<String> {\n let s = s.chars().skip(1).take(s.len() - 2).collect::<Vec<_>>();\n
sugyan
NORMAL
2021-05-13T15:35:07.732363+00:00
2021-05-13T15:35:07.732410+00:00
60
false
```rust\nimpl Solution {\n pub fn ambiguous_coordinates(s: String) -> Vec<String> {\n let s = s.chars().skip(1).take(s.len() - 2).collect::<Vec<_>>();\n let candidates = |v: &[char]| -> Vec<String> {\n (0..v.len())\n .filter_map(|i| {\n let s: String = if i ...
1
1
['Rust']
0
ambiguous-coordinates
[Java] Clean and Fast | Beats 100%
java-clean-and-fast-beats-100-by-lucoram-gw2r
The solution is self explanatory.\n\n\nclass Solution {\n\n public List<String> ambiguousCoordinates(String digits) {\n List<String> answer = new Arra
lucoram
NORMAL
2021-05-13T14:35:00.360292+00:00
2021-05-13T14:35:00.360336+00:00
90
false
The solution is self explanatory.\n\n```\nclass Solution {\n\n public List<String> ambiguousCoordinates(String digits) {\n List<String> answer = new ArrayList<>();\n char[] digitsArr = digits.toCharArray();\n int n = digitsArr.length;\n\n for (int comaIdx = 2; comaIdx < n - 1; comaIdx++) ...
1
0
[]
0
ambiguous-coordinates
816 - The long answer
816-the-long-answer-by-pgmreddy-zghy
Not a simple one :)\n\nLong answer ahead :), with a lot of code duplication. Hopefully others can understand.\n\n var ambiguousCoordinates = function (s) {\n
pgmreddy
NORMAL
2021-05-13T12:19:43.166520+00:00
2021-05-13T12:39:47.635471+00:00
119
false
Not a simple one :)\n\nLong answer ahead :), with a lot of code duplication. Hopefully others can understand.\n\n var ambiguousCoordinates = function (s) {\n let n = s.length;\n\n // answer array\n let A = [];\n\n // remove ( and ), reduce length by 2\n s = s.slice(1, n - 1);\n ...
1
0
['JavaScript']
0
ambiguous-coordinates
C++ clean and short codes
c-clean-and-short-codes-by-mkyang-gh5h
\nchar buf[14];\nclass Solution {\npublic:\n inline bool check(const char *c, int n) {\n return 1==n||c[0]!=\'0\'||c[n-1]!=\'0\';\n }\n vector<s
mkyang
NORMAL
2021-05-13T11:00:38.541174+00:00
2021-05-13T11:00:38.541215+00:00
65
false
```\nchar buf[14];\nclass Solution {\npublic:\n inline bool check(const char *c, int n) {\n return 1==n||c[0]!=\'0\'||c[n-1]!=\'0\';\n }\n vector<string> helper (const char *c, int n) {\n vector<string> ans;\n if(n==1) {\n ans.push_back(string(c, 1));\n return move(an...
1
0
[]
0
ambiguous-coordinates
Simple commented code in C++
simple-commented-code-in-c-by-kanchan191-8ay7
\nclass Solution {\npublic:\n vector<string>fun(string str)\n {\n vector<string>ans;\n int n = str.length();\n if(n == 1)\n {\
kanchan19102000
NORMAL
2021-05-13T10:13:10.745218+00:00
2021-05-13T10:13:10.745250+00:00
69
false
```\nclass Solution {\npublic:\n vector<string>fun(string str)\n {\n vector<string>ans;\n int n = str.length();\n if(n == 1)\n {\n return {str};\n }\n // cases like "123"\n if(str[0] != \'0\')\n {\n ans.push_back(str);\n }\n ...
1
0
[]
0
ambiguous-coordinates
Python3 straightforward solution - Ambiguous Coordinates
python3-straightforward-solution-ambiguo-f5f5
\nclass Solution:\n def ambiguousCoordinates(self, S: str) -> List[str]:\n S = S[1:-1]\n def numbers(s):\n ans = []\n for
r0bertz
NORMAL
2020-10-10T01:54:37.461146+00:00
2020-10-10T01:54:37.461176+00:00
288
false
```\nclass Solution:\n def ambiguousCoordinates(self, S: str) -> List[str]:\n S = S[1:-1]\n def numbers(s):\n ans = []\n for i in range(1, len(s)+1):\n ns = s[:i]\n if s[i:]:\n ns += "." + s[i:]\n if len(ns) > 1 and (...
1
0
['Python', 'Python3']
0
ambiguous-coordinates
C++ Easy Solution Explained
c-easy-solution-explained-by-shaunblaze2-k0ix
The idea is very simple. We continuously split the substring in 2 parts. One is our x coordinate the other is y coordinate. Now the helper function finds the nu
shaunblaze21
NORMAL
2020-07-30T10:44:08.355791+00:00
2020-07-30T10:44:18.463895+00:00
261
false
The idea is very simple. We continuously split the substring in 2 parts. One is our x coordinate the other is y coordinate. Now the helper function finds the number of ways we can form the x coordinate and the y coordinate, we form the final string by combining all x coordinates and y coordinates. Rest of the explanati...
1
0
['C']
0
ambiguous-coordinates
Java solution with a simple predicate
java-solution-with-a-simple-predicate-by-suef
\nclass Solution {\n private Predicate<String> coordinatePredicate =\n s -> !(s.contains(".") && s.endsWith("0") || s.startsWith("0") && s.length(
gozakdag
NORMAL
2020-04-27T23:26:44.196605+00:00
2020-04-27T23:26:44.196639+00:00
157
false
```\nclass Solution {\n private Predicate<String> coordinatePredicate =\n s -> !(s.contains(".") && s.endsWith("0") || s.startsWith("0") && s.length() > 1 && !s.startsWith("0."));\n\n private String removeParentheses(String s) {\n return s.substring(1, s.length() - 1);\n }\n\n public List<...
1
0
[]
0
ambiguous-coordinates
Python intuitive solution
python-intuitive-solution-by-hongsenyu-3pgh
\n\'\'\'\nSplit the number into left and right halves.\nCompute possible combinations of each half\npick one from left comb and one from right comb to build fin
hongsenyu
NORMAL
2020-03-28T06:46:35.065569+00:00
2020-03-28T06:46:35.065608+00:00
188
false
```\n\'\'\'\nSplit the number into left and right halves.\nCompute possible combinations of each half\npick one from left comb and one from right comb to build final results.\nwhen build the combinations of a given word, the helper function doesn\'t count invalid numbers.\ntime complexity: O(n*n*n)\nspace: O(n*n)\n\'\'...
1
0
[]
0
ambiguous-coordinates
C++, easy to understand backtracking idea
c-easy-to-understand-backtracking-idea-b-9xw9
see inline comments\n\nclass Solution {\npublic:\n vector<string> ambiguousCoordinates(string S) {\n vector<string> res;\n S = S.substr(1, S.le
mazytes
NORMAL
2019-04-03T07:48:21.112937+00:00
2019-04-03T07:48:21.112999+00:00
219
false
see inline comments\n```\nclass Solution {\npublic:\n vector<string> ambiguousCoordinates(string S) {\n vector<string> res;\n S = S.substr(1, S.length() - 2);\n dfs(res, S, string(1, S[0]), 1, FIRST);\n return res;\n }\n\nprivate:\n enum STATE {\n FIRST,\n FIRST_PERIOD...
1
1
[]
0
ambiguous-coordinates
Kotlin solution
kotlin-solution-by-huangdachuan-2l8f
\nclass Solution {\n fun ambiguousCoordinates(S: String): List<String> {\n val content = S.substring(1, S.length - 1)\n if (content.length <= 1
huangdachuan
NORMAL
2018-11-03T03:26:27.031315+00:00
2018-11-03T03:26:27.031361+00:00
184
false
```\nclass Solution {\n fun ambiguousCoordinates(S: String): List<String> {\n val content = S.substring(1, S.length - 1)\n if (content.length <= 1) return listOf()\n return (0 until content.length - 1).flatMap {\n val left = decimals(content.substring(0, it + 1))\n val righ...
1
0
[]
0
ambiguous-coordinates
C++ REAL clear 8ms solution, beats 100%!
c-real-clear-8ms-solution-beats-100-by-m-libk
```\n vector ambiguousCoordinates(string S) {\n vector res;\n for(int i=1;i<S.size()-2;i++) {\n vector left=makeNum(S.substr(1, i));
michaelz
NORMAL
2018-08-10T08:34:32.591961+00:00
2018-08-10T08:34:32.592010+00:00
374
false
```\n vector<string> ambiguousCoordinates(string S) {\n vector<string> res;\n for(int i=1;i<S.size()-2;i++) {\n vector<string> left=makeNum(S.substr(1, i));\n vector<string> right=makeNum(S.substr(i+1, S.size()-2-i));\n for(int m=0;m<left.size();m++) {\n ...
1
0
[]
1
ambiguous-coordinates
Python short & easy to understand solution
python-short-easy-to-understand-solution-hhtl
\nclass Solution:\n def ambiguousCoordinates(self, S):\n def properInt(s):\n return len(s) > 1 and s[0] != "0" or len(s) == 1\n \n
cenkay
NORMAL
2018-07-28T20:07:56.109405+00:00
2018-08-10T08:32:26.901786+00:00
206
false
```\nclass Solution:\n def ambiguousCoordinates(self, S):\n def properInt(s):\n return len(s) > 1 and s[0] != "0" or len(s) == 1\n \n def properFloat(s, i):\n return s[-1] not in ".0" and properInt(s[:i])\n \n s, res = S[1:-1], set()\n for i in range(le...
1
1
[]
0
ambiguous-coordinates
A few solutions
a-few-solutions-by-claytonjwong-0sg1
May 13th, 2021:\n\nJavascript\n\nlet ambiguousCoordinates = s => {\n let allZeros = s => !_.trim(s, \'0\').length;\n let okStart = s => {\n let t =
claytonjwong
NORMAL
2018-04-16T21:23:04.283841+00:00
2021-05-13T21:04:38.214023+00:00
217
false
**May 13<sup>th</sup>, 2021:**\n\n*Javascript*\n```\nlet ambiguousCoordinates = s => {\n let allZeros = s => !_.trim(s, \'0\').length;\n let okStart = s => {\n let t = _.trimStart(s, \'0\');\n let M = s.length,\n N = t.length\n return M == N || (t[0] == \'.\' && M - 1 == N); // no ...
1
1
[]
0
ambiguous-coordinates
My c++ solution
my-c-solution-by-0xac-6v9q
\nclass Solution {\npublic:\n vector<string> ambiguousCoordinates(string S) {\n vector<string> results;\n string result;\n S = S.substr(
0xac
NORMAL
2018-04-15T05:05:35.926001+00:00
2018-04-15T05:05:35.926001+00:00
128
false
```\nclass Solution {\npublic:\n vector<string> ambiguousCoordinates(string S) {\n vector<string> results;\n string result;\n S = S.substr(1, S.size() - 2);\n for(int i = 1; i < S.size(); ++i)\n {\n string sLeft = S.substr(0, i);\n if (!valid(sLeft)) continue;...
1
1
[]
0
ambiguous-coordinates
My Java Solution (39ms)
my-java-solution-39ms-by-silenceleaf-1niq
\n\nclass Solution {\n public List<String> ambiguousCoordinates(String S) {\n char[] array = S.toCharArray();\n int start = 1;\n int end
silenceleaf
NORMAL
2018-04-15T03:16:20.902112+00:00
2018-08-10T08:32:52.703592+00:00
217
false
```\n\nclass Solution {\n public List<String> ambiguousCoordinates(String S) {\n char[] array = S.toCharArray();\n int start = 1;\n int end = S.length() - 1; // not include\n List<String> result = new ArrayList<>();\n for (int split = start + 1; split < end; split++) {\n ...
1
1
[]
0
ambiguous-coordinates
C++ Solution with Explanation
c-solution-with-explanation-by-code_repo-29f7
````\n#define FORI(s,n) for(int i = s; i < n; i++)\n#define FORJ(s,n) for(int j = s; j < n; j++)\n#define FORK(s,n) for(int k = s; k < n; k++)\n\nclass Solution
code_report
NORMAL
2018-04-15T03:12:43.935236+00:00
2018-08-10T08:33:03.269258+00:00
251
false
````\n#define FORI(s,n) for(int i = s; i < n; i++)\n#define FORJ(s,n) for(int j = s; j < n; j++)\n#define FORK(s,n) for(int k = s; k < n; k++)\n\nclass Solution {\npublic:\n \n // General idea:\n // 1. Shave off parentheses of S\n // 2. Iterate through index 1 to S.len - 1 (where you can put commas)\n //...
1
1
[]
1
ambiguous-coordinates
Simple commented Python Solution
simple-commented-python-solution-by-luck-5gi5
\nclass Solution:\n def ambiguousCoordinates(self, S):\n \n def possible_val(S):\n ret = set()\n # S itself valid\n
luckypants
NORMAL
2018-04-15T03:07:19.801747+00:00
2018-04-15T03:07:19.801747+00:00
176
false
```\nclass Solution:\n def ambiguousCoordinates(self, S):\n \n def possible_val(S):\n ret = set()\n # S itself valid\n if S[0]!=\'0\' or len(S)==1:\n ret.add(S)\n for _ in range(1, len(S)):\n left, right = S[:_], S[_:]\n ...
1
1
[]
0
ambiguous-coordinates
Explained Cpp code
explained-cpp-code-by-aviadblumen-4mzq
IntuitionApproachComplexity Time complexity: Space complexity: Code
aviadblumen
NORMAL
2025-04-10T17:50:36.510994+00:00
2025-04-10T17:50:36.510994+00:00
1
false
# Intuition <!-- Describe your first thoughts on how to solve this problem. --> # Approach <!-- Describe your approach to solving the problem. --> # Complexity - Time complexity: <!-- Add your time complexity here, e.g. $$O(n)$$ --> - Space complexity: <!-- Add your space complexity here, e.g. $$O(n)$$ --> # Code `...
0
0
['C++']
0
ambiguous-coordinates
Ambiguous Coordinates
ambiguous-coordinates-by-ansh1707-tt0m
Complexity Time complexity: O(N) Space complexity: O(N) Code
Ansh1707
NORMAL
2025-02-10T16:55:35.973018+00:00
2025-02-10T16:55:35.973018+00:00
4
false
# Complexity - Time complexity: O(N) <!-- Add your time complexity here, e.g. $$O(n)$$ --> - Space complexity: O(N) <!-- Add your space complexity here, e.g. $$O(n)$$ --> # Code ```python [] class Solution(object): def ambiguousCoordinates(self, s): """ :type s: str :rtype: List[str] ...
0
0
['String', 'Backtracking', 'Enumeration', 'Python']
0
ambiguous-coordinates
Simple Java Solution
simple-java-solution-by-sakshikishore-fzok
Code
sakshikishore
NORMAL
2025-01-29T12:40:17.428487+00:00
2025-01-29T12:40:17.428487+00:00
7
false
# Code ```java [] public class Node { String str1,str2; Boolean dot1=false,dot2=false; public Node(String s1, String s2, Boolean d1, Boolean d2) { str1=s1; str2=s2; dot1=d1; dot2=d2; } } class Solution { public List<String> ambiguousCoordinates(String s) { ...
0
0
['Java']
0
ambiguous-coordinates
go 1.21, clean code
go-121-clean-code-by-colix-ucn8
null
colix
NORMAL
2025-01-22T10:25:49.438510+00:00
2025-01-22T10:25:49.438510+00:00
2
false
```golang [] func ambiguousCoordinates(s string) []string { s = s[1 : len(s)-1] var ret []string for i := 1; i < len(s); i++ { left, right := s[:i], s[i:] leftParts, rightParts := getValidNumbers(left), getValidNumbers(right) for _, leftPart := range leftParts { for _, rightPart := range rightParts { re...
0
0
['Go']
0
ambiguous-coordinates
816. Ambiguous Coordinates
816-ambiguous-coordinates-by-g8xd0qpqty-j7ou
IntuitionApproachComplexity Time complexity: Space complexity: Code
G8xd0QPqTy
NORMAL
2025-01-11T06:20:12.029785+00:00
2025-01-11T06:20:12.029785+00:00
8
false
# Intuition <!-- Describe your first thoughts on how to solve this problem. --> # Approach <!-- Describe your approach to solving the problem. --> # Complexity - Time complexity: <!-- Add your time complexity here, e.g. $$O(n)$$ --> - Space complexity: <!-- Add your space complexity here, e.g. $$O(n)$$ --> # Code `...
0
0
['Python3']
0
ambiguous-coordinates
小筆記
xiao-bi-ji-by-avisccc-makx
Approach先把它分成兩部份後利用check()各自排列,因為不可以有00.1,1.10等情況所以利用條件事來規避,等兩部分各自排列完成後再利用雙for迴圈來做最後一次排列Code
avisccc
NORMAL
2025-01-07T02:24:52.547147+00:00
2025-01-07T02:24:52.547147+00:00
7
false
# Approach <!-- Describe your approach to solving the problem. --> 先把它分成兩部份後利用check()各自排列,因為不可以有00.1,1.10等情況所以利用條件事來規避,等兩部分各自排列完成後再利用雙for迴圈來做最後一次排列 # Code ```cpp [] class Solution { public: vector<string> ambiguousCoordinates(string s) { vector<string> ans; // 移除括号 s.erase(0, 1); ...
0
0
['C++']
0
ambiguous-coordinates
Enumeration(Implicit Backtracing) O(n^3) Time Complexity
enumerationimplicit-backtracing-on3-time-yzad
Intuition Check all possible combinations no need of backtracking. Complexity Time complexity: O(n3) Space complexity: O(n) Code
yash559
NORMAL
2024-12-31T11:19:21.827256+00:00
2024-12-31T11:19:21.827256+00:00
6
false
# Intuition - Check all possible combinations **no need of backtracking.** # Complexity - Time complexity: $$O(n^3)$$ <!-- Add your time complexity here, e.g. $$O(n)$$ --> - Space complexity: $$O(n)$$ <!-- Add your space complexity here, e.g. $$O(n)$$ --> # Code ```cpp [] class Solution { public: vector<string> ...
0
0
['C++']
0
ambiguous-coordinates
My java 8ms solution 53% faster
my-java-8ms-solution-53-faster-by-raghav-khd4
IntuitionApproachComplexity Time complexity: Space complexity: Code
raghavrathore7415
NORMAL
2024-12-25T11:19:28.554948+00:00
2024-12-25T11:19:28.554948+00:00
5
false
# Intuition <!-- Describe your first thoughts on how to solve this problem. --> # Approach <!-- Describe your approach to solving the problem. --> # Complexity - Time complexity: <!-- Add your time complexity here, e.g. $$O(n)$$ --> - Space complexity: <!-- Add your space complexity here, e.g. $$O(n)$$ --> # Code `...
0
0
['Java']
0
ambiguous-coordinates
C++ Solution
c-solution-by-hn84de-vztn
Code\ncpp []\nclass Solution {\npublic:\n bool valid(const string& s) {\n if (s.empty()) return false;\n if (s == "0") return true;\n if
hn84de
NORMAL
2024-12-04T03:49:57.020076+00:00
2024-12-04T03:49:57.020102+00:00
4
false
# Code\n```cpp []\nclass Solution {\npublic:\n bool valid(const string& s) {\n if (s.empty()) return false;\n if (s == "0") return true;\n if (s[0] == \'0\') return false;\n return true;\n }\n bool validDecimal(const string& s) {\n bool flag = true;\n for (char c : s) ...
0
0
['C++']
0
ambiguous-coordinates
scala list comprehension
scala-list-comprehension-by-vititov-wuq7
could be improved with memoization\nscala []\nobject Solution {\n def ambiguousCoordinates(s: String): List[String] = {\n val d0 = s.tail.init\n for{\n
vititov
NORMAL
2024-10-16T20:53:48.205296+00:00
2024-10-16T20:53:48.205330+00:00
1
false
could be improved with memoization\n```scala []\nobject Solution {\n def ambiguousCoordinates(s: String): List[String] = {\n val d0 = s.tail.init\n for{\n i0 <- (0 to d0.length).toList\n (t1,d1) = d0.splitAt(i0)\n if t1.length==1 || (t1.length>1 && t1.head != \'0\')\n\n i1 <- (0 to d1.length)...
0
0
['Linked List', 'String', 'Enumeration', 'Scala']
0
ambiguous-coordinates
Beats 100% time, somehow
beats-100-time-somehow-by-quindecim413-xefa
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time
quindecim413
NORMAL
2024-08-08T19:50:56.579771+00:00
2024-08-08T19:50:56.579820+00:00
31
false
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n$$O(n^3)$$\n- Space complexity:\n<!-- Add your space complexity here, e.g. $...
0
0
['Python3']
0
ambiguous-coordinates
JS solution enumeration
js-solution-enumeration-by-siddharthpunt-m0rx
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time
siddharthpuntambekar
NORMAL
2024-08-05T05:29:53.487943+00:00
2024-08-05T05:29:53.487973+00:00
8
false
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ --...
0
0
['JavaScript']
0
ambiguous-coordinates
Java | Backtracking | Explained
java-backtracking-explained-by-prashant4-bwp7
Idea:\n Consider all possible non-empty breakdowns of s\n Put decimal in both parts in every possible place and check if the output is valid\n If valid, then ad
prashant404
NORMAL
2024-07-02T22:27:52.266078+00:00
2024-07-02T22:27:52.266111+00:00
6
false
**Idea:**\n* Consider all possible non-empty breakdowns of s\n* Put decimal in both parts in every possible place and check if the output is valid\n* If valid, then add them to the result\n* For validity:\n\t* If a number doesn\'t have a decimal, then it should either be 0 or not have a leading 0\n\t* Else if a number ...
0
0
['Java']
0
ambiguous-coordinates
C# Backtracking with Validation Solution
c-backtracking-with-validation-solution-iga6s
Intuition\n Describe your first thoughts on how to solve this problem. To solve the problem of generating all possible original coordinates from a given string
GetRid
NORMAL
2024-06-27T14:19:02.246940+00:00
2024-06-27T14:19:02.246979+00:00
18
false
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->To solve the problem of generating all possible original coordinates from a given string s, we need to explore all ways to split the string into two parts and then generate valid coordinate representations for each part.\n___\n\n# Approach\...
0
0
['String', 'Backtracking', 'C#']
0
ambiguous-coordinates
Simple C++ Solution
simple-c-solution-by-abhishek_499-tst1
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time
Abhishek_499
NORMAL
2024-05-24T19:01:50.954775+00:00
2024-05-24T19:01:50.954794+00:00
16
false
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ --...
0
0
['C++']
0
ambiguous-coordinates
Beats 100% users with rust
beats-100-users-with-rust-by-user0353du-9ueh
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time
user0353DU
NORMAL
2024-05-16T08:09:48.725926+00:00
2024-05-16T08:09:48.725954+00:00
6
false
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ --...
0
0
['Backtracking', 'Rust']
0
ambiguous-coordinates
Fast, Simple, Easy to understand, C++
fast-simple-easy-to-understand-c-by-bilb-wtjw
Intuition\n Describe your first thoughts on how to solve this problem. \nThe problem requires generating all possible ambiguous coordinates from a given string
bilbobilley
NORMAL
2024-05-06T09:37:41.479073+00:00
2024-05-06T09:37:41.479147+00:00
14
false
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nThe problem requires generating all possible ambiguous coordinates from a given string representing a number. Ambiguous coordinates are those that can be interpreted in multiple ways by adding a decimal point at different positions. For e...
0
0
['C++']
0
ambiguous-coordinates
Split at each position and enumerate combinations
split-at-each-position-and-enumerate-com-ns6i
The idea\n1. Split string at each position into 2 parts. e.g. 1234 -> 1|234, 12|34, 123|4\n2. Enumerate positions for .\n\n> How to handle parts?\n\nFor a part
vokasik
NORMAL
2024-05-06T00:03:31.811783+00:00
2024-05-06T00:46:12.431168+00:00
20
false
> The idea\n1. Split string at each position into 2 parts. e.g. `1234 -> 1|234, 12|34, 123|4`\n2. Enumerate positions for `.`\n\n> How to handle parts?\n\nFor a part there are 2 cases:\n1) A string (e.g. `5`, `555`)\nOR\n2) A string with the decimal point (e.g. `5.05`, `50.5`)\n\n> Part validation\n\nEach part needs to...
0
0
['Python', 'Python3']
0