File tree Expand file tree Collapse file tree 6 files changed +53
-0
lines changed
Expand file tree Collapse file tree 6 files changed +53
-0
lines changed Original file line number Diff line number Diff line change 1+ // https://school.programmers.co.kr/learn/courses/30/lessons/181847
2+
3+ function solution ( n_str ) {
4+ for ( let i = 0 ; i < n_str . length ; i ++ ) {
5+ if ( n_str [ i ] !== '0' ) {
6+ return n_str . slice ( i ) ;
7+ }
8+ }
9+ }
Original file line number Diff line number Diff line change 1+ // https://school.programmers.co.kr/learn/courses/30/lessons/181841
2+
3+ function solution ( str_list , ex ) {
4+ let answer = '' ;
5+ for ( let str of str_list ) {
6+ if ( ! str . includes ( ex ) ) answer += str ;
7+ }
8+ return answer ;
9+ }
Original file line number Diff line number Diff line change 1+ // https://school.programmers.co.kr/learn/courses/30/lessons/181842
2+
3+ function solution ( str1 , str2 ) {
4+ return str2 . includes ( str1 ) ? 1 : 0 ;
5+ }
6+
7+ // 다른 풀이
8+ // true → 1, false → 0 변환이 자동으로 일어난다
9+ /**
10+ * return Number(str2.includes(str1));
11+ */
Original file line number Diff line number Diff line change 1+ // https://school.programmers.co.kr/learn/courses/30/lessons/181843
2+
3+ function solution ( my_string , target ) {
4+ return Number ( my_string . includes ( target ) ) ;
5+ }
Original file line number Diff line number Diff line change 1+ // https://school.programmers.co.kr/learn/courses/30/lessons/70128
2+
3+ function solution ( a , b ) {
4+ let sum = 0 ;
5+ const len = a . length ;
6+
7+ for ( let i = 0 ; i < len ; i ++ ) {
8+ sum += a [ i ] * b [ i ] ;
9+ }
10+
11+ return sum ;
12+ }
Original file line number Diff line number Diff line change 1+ // https://school.programmers.co.kr/learn/courses/30/lessons/12935
2+
3+ function solution ( arr ) {
4+ if ( arr . length <= 1 ) return [ - 1 ] ;
5+ const min = Math . min ( ...arr ) ;
6+ return arr . filter ( num => num !== min ) ;
7+ }
You can’t perform that action at this time.
0 commit comments