We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 02846ee commit 51557c9Copy full SHA for 51557c9
1주차/이진아/레벨1__같은_숫자는_싫어.js
@@ -0,0 +1,9 @@
1
+function solution(arr) {
2
+ var answer = [];
3
+ for(let i = 0; i < arr.length; i++){
4
+ if(arr[i] !== arr[i+1]){
5
+ answer.push(arr[i])
6
+ }
7
8
+ return answer;
9
+}
1주차/이진아/레벨2__올바른_괄호.js
@@ -0,0 +1,23 @@
+function solution(s){
+ var answer = true;
+ let arr=[];
+
+ for(let i=0;i<s.length;i++) {
+ if(s[i]==='(') {
+ arr.push('(')
+ else {
10
+ if(arr[arr.length-1]==='(') {
11
+ arr.pop();
12
13
14
+ arr.push(')');
15
16
17
18
19
+ if(arr.length!==0) {
20
+ answer = false;
21
22
23
0 commit comments