728x90
๋ฐ˜์‘ํ˜•
 ํฌ์ŠคํŒ… ์ธ๋„ค์ผ ์ด๋ฏธ์ง€

๋ธ”๋กœ๊ทธ/ํ‹ฐ์Šคํ† ๋ฆฌ ํŒ

[์›นํฐํŠธ] ํ‹ฐ์Šคํ† ๋ฆฌ ๋ธ”๋กœ๊ทธ ๋‚˜๋ˆ”๋ฐ”๋ฅธ๊ณ ๋”• ํฐํŠธ ์ ์šฉ

ํ•˜๋ฃจ์— ์ ์ง€์•Š์€ ์–‘์˜ ๊ธ€๋“ค(์ฃผ๋กœ ์›นํŽ˜์ด์ง€)์„ ์ฝ๊ฒŒ ๋˜๋Š”๋ฐ ์ด๋”ฐ๊ธˆ์”ฉ ๊ธ€๊ผด์˜ ์ค‘์š”์„ฑ์„ ์‹ค๊ฐํ•˜๊ฒŒ ๋ฉ๋‹ˆ๋‹ค. ์ €๋Š” ๊ธ€๊ผด ์ค‘์—๋„ "๋‚˜๋ˆ”๋ฐ”๋ฅธ๊ณ ๋”•"์„ ์„ ํ˜ธํ•˜๋Š”๋ฐ์š”. ํ‹ฐ์Šคํ† ๋ฆฌ ๋ธ”๋กœ๊ทธ๋ฅผ ์‹œ์ž‘ํ•˜๋ฉด์„œ ๋ธ”๋กœ๊ทธ ๋””ํดํŠธ ํฐํŠธ๋กœ ๋‚˜๋ˆ”๋ฐ”๋ฅธ๊ณ ๋”•์œผ๋กœ ์„ค์ •ํ–ˆ์Šต๋‹ˆ๋‹ค. ์›นํฐํŠธ๋กœ ํฐํŠธ๋ฅผ ์ ์šฉ์‹œ์ผฐ๊ณ , ์ ์šฉ์‹œํ‚ค๋Š” ๋ฒ•์— ๋Œ€ํ•ด์„œ ์ด์„ค๋ช…ํ•˜๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค ! HTML / CSS๋ฅผ ๋ชจ๋ฅด๋Š” ์ดˆ์‹ฌ์ž๋ฅผ ๋Œ€์ƒ์œผ๋กœ ์‰ฝ๊ฒŒ ์„ค๋ช…ํ•  ์˜ˆ์ •์ด๋‹ˆ ์ด ๊ธ€์„ ์ญ‰ ๋”ฐ๋ผ์„œ ์ ์šฉํ•˜์‹œ๋ฉด ์‰ฝ๊ฒŒ ์ ์šฉํ•˜์‹ค ์ˆ˜ ์žˆ์„ ๊ฒ๋‹ˆ๋‹ค. ์™ผ์ชฝ ์ค‘๊ฐ„์ฏค์— ์žˆ๋Š” HTML / CSS ํŽธ์ง‘์„ ๋“ค์–ด๊ฐ€๋ฉด ์ด๋ ‡๊ฒŒ HTML/ CSS์„ ํŽธ์ง‘ํ•  ์ˆ˜ ์žˆ๋Š” ์—๋””ํ„ฐ๋ฅผ ๋ณด์‹ค ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.์ด์ œ ์—ฌ๊ธฐ์„œ ๋ช‡ ๊ฐ€์ง€ ์ฝ”๋“œ๋ฅผ ์ ์šฉ์„ ์‹œ์ผœ์•ผ ๋˜๋Š”๋ฐ์š”. ์˜ค๋ฅธ์ชฝ HTML ๋ฌธ์„œ ํŒŒ์ผ์— ๋ถ€๋ถ„์ด ์žˆ์„๊ฒ๋‹ˆ๋‹ค. ๊ทธ ๋ฐ”๋กœ ์œ„์— ์•„๋ž˜์— ์ฝ”๋“œ๋ฅผ ์ง‘์–ด ๋„ฃ๋„๋ก ํ•˜๊ฒ ..

2016.09.22 ๊ฒŒ์‹œ๋จ

 ํฌ์ŠคํŒ… ์ธ๋„ค์ผ ์ด๋ฏธ์ง€

Computer science/์•Œ๊ณ ๋ฆฌ์ฆ˜

[์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ๋กœ ๊ตฌํ˜„ํ•œ ์•Œ๊ณ ๋ฆฌ์ฆ˜] IQ Test

Bob is preparing to pass IQ test. The most frequent task in this test is to find out which one of the given numbers differs from the others. Bob observed that one number usually differs from the others in evenness. Help Bob โ€” to check his answers, he needs a program that among the given numbers finds one that is different in evenness, and return a position of this number. ! Keep in mind that you..

2016.09.21 ๊ฒŒ์‹œ๋จ

 ํฌ์ŠคํŒ… ์ธ๋„ค์ผ ์ด๋ฏธ์ง€

Computer science/์•Œ๊ณ ๋ฆฌ์ฆ˜

[์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ๋กœ ๊ตฌํ˜„ํ•œ ์•Œ๊ณ ๋ฆฌ์ฆ˜] Exes and Ohs

Description: Check to see if a string has the same amount of 'x's and 'o's. The method must return a boolean and be case insensitive. The string can contains any char. Examples input/output: XO("ooxx") => true XO("xooxx") => false XO("ooxXm") => true XO("zpzpzpp") => true // when no 'x' and 'o' is present should return true XO("zzoo") => false

2016.09.21 ๊ฒŒ์‹œ๋จ

 ํฌ์ŠคํŒ… ์ธ๋„ค์ผ ์ด๋ฏธ์ง€

Computer science/์•Œ๊ณ ๋ฆฌ์ฆ˜

[์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ๋กœ ๊ตฌํ˜„ํ•œ ์•Œ๊ณ ๋ฆฌ์ฆ˜] Find the next perfect square!

Description: You might know some pretty large perfect squares. But what about the NEXT one? Complete the findNextSquare method that finds the next integral perfect square after the one passed as a parameter. Recall that an integral perfect square is an integer n such that sqrt(n) is also an integer. If the parameter is itself not a perfect square, than -1 should be returned. You may assume the p..

2016.09.21 ๊ฒŒ์‹œ๋จ

 ํฌ์ŠคํŒ… ์ธ๋„ค์ผ ์ด๋ฏธ์ง€

๊ฐœ๋ฐœ/Javascript

[์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ] ๊ฐ์ฒด (Javascript - Object)

์ด๋ฒˆ ๊ธ€์€ ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ์˜ ํ•ต์‹ฌ์ด๊ธฐ๋„ ํ•˜์ง€๋งŒ, ์ดํ•ดํ•˜๊ธฐ ์–ด๋ ค์šด ๊ฐ์ฒด์— ๋Œ€ํ•ด์„œ ๋‹ค๋ค„๋ณด๋ ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค.์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ๋Š” ๊ฐ์ฒด ๊ธฐ๋ฐ˜์˜ ์Šคํฌ๋ฆฝํŠธ ์–ธ์–ด์ด๋ฉฐ ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ๋ฅผ ์ด๋ฃจ๊ณ  ์žˆ๋Š” ๊ฑฐ์˜ ๋ชจ๋“  ๊ฒƒ๋“ค์ด ๊ฐ์ฒด๋กœ ์กด์žฌํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋ ‡๊ธฐ ๋•Œ๋ฌธ์— ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ๋ฅผ ๊ณต๋ถ€ํ•  ๋•Œ ๊ผญ ์ •๋ณตํ•ด์•ผ ํ•ด์•ผ ํ•˜๋Š” ๊ฒƒ์ด ๋ฐ”๋กœ โ€œ๊ฐ์ฒดโ€์ด๊ธฐ๋„ ํ•ฉ๋‹ˆ๋‹ค. ํ•œ๋งˆ๋””๋กœ ๊ฐ์ฒด๋Š” ์ž์‹ ์˜ ์ •๋ณด๋ฅผ ๊ฐ€์ง€๊ณ  ์žˆ๋Š” ๋…๋ฆฝ์ ์ธ ์ฃผ์ฒด์ž…๋‹ˆ๋‹ค.๊ฐ์ฒด๋ฅผ ์ดํ•ดํ•˜๋ ค๋ฉด 'ํ”„๋กœํผํ‹ฐ'์™€ '๋ฉ”์†Œ๋“œ'๋ฅผ ์ดํ•ดํ•˜๊ณ  ์žˆ์–ด์•ผํ•ฉ๋‹ˆ๋‹ค.๊ฐ์ฒด๋ž€ ๊ฒƒ์€ ๊ฒฐ๊ตญ ํฌ์žฅ์„ ์ด๋ฃจ๋Š” ๋ง์ด๊ณ  ์‹ค์ œ ๊ฐ์ฒด๋ฅผ ์™„์„ฑ์‹œ์ผœ์ฃผ๋Š” ๊ฒƒ์€ ํ”„๋กœํผํ‹ฐ์™€ ๋ฉ”์†Œ๋“œ๋ผ๋Š” ๊ตฌ์„ฑ์š”์†Œ์ด๊ธฐ ๋•Œ๋ฌธ์ž…๋‹ˆ๋‹ค.์ดํ•ดํ•˜๊ธฐ ์‰ฝ๊ฒŒ ์•„๋ž˜ ๊ทธ๋ฆผ์œผ๋กœ ๊ฐ์ฒด์— ๋Œ€ํ•ด ์‰ฝ๊ฒŒ ์„ค๋ช…ํ•ด ๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค. ์šฐ๋ฆฌ๊ฐ€ ๊ฐ์ฒด๋ผ๊ณ  ๋ถ€๋ฅด๋Š” ๊ฒƒ์€ ๋ฐ”๋กœ ์ปดํ“จํ„ฐ ์ผ€์ด์Šค์— ํ•ด๋‹นํ•˜๋Š”๋ฐ์š”. ์‹ค์ œ ์ปดํ“จํ„ฐ๋ฅผ ๊ตฌ์„ฑํ•˜๋Š” ๊ฒƒ์€ ๋ฉ”๋ชจ๋ฆฌ, ๊ทธ..

2016.09.21 ๊ฒŒ์‹œ๋จ

 ํฌ์ŠคํŒ… ์ธ๋„ค์ผ ์ด๋ฏธ์ง€

Computer science/์•Œ๊ณ ๋ฆฌ์ฆ˜

[์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ๋กœ ๊ตฌํ˜„ํ•œ ์•Œ๊ณ ๋ฆฌ์ฆ˜] Isograms

Description: An isogram is a word that has no repeating letters, consecutive or non-consecutive. Implement a function that determines whether a string that contains only letters is an isogram. Assume the empty string is an isogram. Ignore letter case. isIsogram( "Dermatoglyphics" ) == true isIsogram( "aba" ) == false isIsogram( "moOse" ) == false // -- ignore letter case ๊ฐ™์€ ๋ฌธ์ž๊ฐ€ ๋‚˜์˜ค๋ฉด false๋ฅผ return..

2016.09.20 ๊ฒŒ์‹œ๋จ

 ํฌ์ŠคํŒ… ์ธ๋„ค์ผ ์ด๋ฏธ์ง€

Computer science/์•Œ๊ณ ๋ฆฌ์ฆ˜

[์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ๋กœ ๊ตฌํ˜„ํ•œ ์•Œ๊ณ ๋ฆฌ์ฆ˜] Credit Card Mask

Description: Usually when you buy something, you're asked whether your credit card number, phone number or answer to your most secret question is still correct. However, since someone could look over your shoulder, you don't want that shown on your screen. Instead, we mask it. Your task is to write a function maskify, which changes all but the last four characters into '#'. Examples maskify("455..

2016.09.20 ๊ฒŒ์‹œ๋จ

 ํฌ์ŠคํŒ… ์ธ๋„ค์ผ ์ด๋ฏธ์ง€

Computer science/์•Œ๊ณ ๋ฆฌ์ฆ˜

[์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ๋กœ ๊ตฌํ˜„ํ•œ ์•Œ๊ณ ๋ฆฌ์ฆ˜] Descending Order

Description:Your task is to make a function that can take any non-negative integer as a argument and return it with it's digits in descending order. Descending order means that you take the highest digit and place the next highest digit immediately after it.Examples:Input: 145263 Output: 654321Input: 1254859723 Output: 9875543221 Number ๋ฐ์ดํ„ฐ ํƒ€์ž…์„ String ๋ฐ์ดํ„ฐ ํƒ€์ž…์œผ๋กœ ๋ณ€ํ™˜ ํ›„ ๋ฐฐ์—ด๋กœ ์ •๋ ฌํ•˜๊ณ  ๋‚ด๋ฆผ์ฐจ์ˆœ์œผ๋กœ ์ •๋ ฌํ•œ ๋‹ค์Œ ๋‹ค์‹œ Numb..

2016.09.20 ๊ฒŒ์‹œ๋จ

 ํฌ์ŠคํŒ… ์ธ๋„ค์ผ ์ด๋ฏธ์ง€

Computer science/์•Œ๊ณ ๋ฆฌ์ฆ˜

[์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ๋กœ ๊ตฌํ˜„ํ•œ ์•Œ๊ณ ๋ฆฌ์ฆ˜] Vowel Count

Description:Return the number (count) of vowels in the given string.We will consider a, e, i, o, and u as vowels for this Kata. ๋ชจ์Œ์„ ์ฒดํฌํ•˜๋Š” ๋กœ์ง์„ ๊ฐ„๋‹จํ•˜๊ฒŒ ๊ตฌํ˜„ํ–ˆ๋‹ค. ์•„์ง์€ ํ—ˆ์ ‘ํ•˜๊ธฐ ๊ทธ์ง€์—†๋Š” ์ฝ”๋“œ๋‹ค.์ข€ ๋” ๊ฐœ๋ฐœ์ž๋‹ต๊ฒŒ ์ฝ”๋“œ๋ฅผ ๊ฐœ์„ ํ•ด๋ณด๋ฉด ์•„๋ž˜์™€ ๊ฐ™๋‹ค. ๋งค์šฐ ๊ฐ„๋‹จํ•˜์ง€ ์•Š์€๊ฐ€?์ด์™€ ๊ฐ™์ด ์ฝ”๋“œ์˜ ๊ฐ€๋…์„ฑ๊ณผ ํšจ์œจ์„ฑ๊นŒ์ง€ ์ƒ๊ฐํ•˜๋ฉด์„œ ์งค ์ˆ˜ ์žˆ๋Š” ๊ฐœ๋ฐœ์ž๊ฐ€ ๋  ์ˆ˜ ์žˆ๋„๋ก ๋…ธ๋ ฅํ•ด์•ผ๊ฒ ๋‹ค. ์ฐธ๊ณ ๋กœ /[aeiou]/ ์™€ ๊ฐ™์€ ๊ฒฝ์šฐ๋Š” ์ •๊ทœํ‘œํ˜„์‹์œผ๋กœ aeiou ์ค‘ 1๊ฐœ๊ฐ€ ํฌํ•จ๋˜๋Š”์ง€ ์ฒดํฌํ•ด์ฃผ๋Š” ๊ฒƒ์ด๋‹ค. ๋’ค์— ig์˜ ๊ฒฝ์šฐ ๋Œ€๋ฌธ์ž/์†Œ๋ฌธ์ž๋ฅผ ๊ตฌ๋ณ„ํ•˜์ง€ ์•Š๊ฒŒ ํ•ด์ฃผ๋Š” ์ˆ˜์‹์–ด๋‹ค.

2016.09.19 ๊ฒŒ์‹œ๋จ

 ํฌ์ŠคํŒ… ์ธ๋„ค์ผ ์ด๋ฏธ์ง€

๊ฐœ๋ฐœ/CSS3

[CSS3] Position : Float

์ด์•ผ๊ธฐ์— ์•ž์„œ ์›น ๋ฌธ์„œ๊ฐ€ ํฌํ•จํ•˜๋Š” ๋ชจ๋“  ์š”์†Œ์˜ ์œ„์น˜๋ฅผ ์žก๋Š” ํฌ์ง€์…”๋‹(Positioning)์€ ์‚ฌ์‹ค ์›น ๋””์ž์ธ์˜ ๋ชจ๋“  ๊ฒƒ์ด๋ผ๊ณ  ํ‘œํ˜„ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ง‘์„ ์ง€์„ ๋•Œ๋„ ๊ทธ์— ๋งž๋Š” Frame์„ ์ž˜ ์„ค๊ณ„๋ฅผ ํ•ด์•ผ ์›ํ•˜๋Š” ๋ชจ์–‘์˜ ์ง‘์„ ์ž˜ ์ง€์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์›น์‚ฌ์ดํŠธ๋„ ๋งˆ์ฐฌ๊ฐ€์ง€ ์ž…๋‹ˆ๋‹ค. ๋งŒ๋“ค๊ณ ์žํ•˜๋Š” ์›น์‚ฌ์ดํŠธ์˜ Layout์„ ์ž˜ ์žก์•„๋†”์•ผ ๊ทธ ๋‹ค์Œ ์„ธ๋ถ€์ ์ธ ๋””์ž์ธ์„ ์‰ฝ๊ฒŒ ์ ์šฉ์‹œํ‚ฌ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.ํ•˜์ง€๋งŒ ํฌ์ง€์…”๋‹์€ ๊ฝค ๋‹ค์–‘ํ•œ ๊ฐœ๋…์„ ์ดํ•ดํ•˜๊ณ  ๊ทธ๊ฒƒ์„ ๋ณตํ•ฉ์ ์œผ๋กœ ์ž˜ ์‚ฌ์šฉํ•ด์•ผ๋งŒ ์›ํ•˜๋Š” ๊ฒฐ๊ณผ๋ฅผ ์–ป์„ ์ˆ˜ ์žˆ์„๋ฟ๋”๋Ÿฌ, ํ˜„์žฌ์˜ ๊ธฐ์ˆ ๋กœ ํฌ์ง€์…”๋‹์„ ํ•˜๋Š”๋ฐ ์žˆ์–ด์„œ ๋ถ€๋”ชํžˆ๋Š” ํ•œ๊ณ„์™€ ๋ฒ„๊ทธ๋“ค์— ๋Œ€ํ•œ ์ดํ•ด๋„ ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค. ์ด ๊ธ€์—์„œ๋Š” ํฌ์ง€์…”๋‹์„ ํ†ตํ•ด HTML ๋ฌธ๋ฒ•์€ ๋ฌผ๋ก , ์›น ๋””์ž์ธ์„ ์œ„ํ•œ ๊ธฐ์ดˆ ๊ณจ๊ฒฉ์„ ๋งŒ๋“œ๋Š” ๋ถ€๋ถ„์— ๋Œ€ํ•œ ๊ฐœ๋…๊นŒ์ง€ ์–ด๋Š์ •๋„ ํ™•๋ฆฝํ•  ์ˆ˜ ..

2016.09.19 ๊ฒŒ์‹œ๋จ

 ํฌ์ŠคํŒ… ์ธ๋„ค์ผ ์ด๋ฏธ์ง€

๊ฐœ๋ฐœ/Javascript

์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ ํ˜ธ์ด์ŠคํŒ…(javascript hoisting)

์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ๋ฅผ ๊ณต๋ถ€ํ•˜๋‹ค๋ณด๋ฉด ๋‹ค๋ฅธ ์–ธ์–ด์™€ ๋‹ค๋ฅธ ์ ์ด ๋ช‡ ๊ฐ€์ง€ ์žˆ์Šต๋‹ˆ๋‹ค. ๊ทธ ์ค‘ ํ˜ธ์ด์ŠคํŒ… (Hoisting)์ด๋ผ ๋ถˆ๋ฆฌ๋Š” ๊ฒƒ์ด ์žˆ๋Š”๋ฐ ์ด ํฌ์ŠคํŒ…์€ ํ˜ธ์ด์ŠคํŒ…์— ๋Œ€ํ•ด ์•Œ์•„๋ณด๋Š” ๊ฒƒ์— ์ค‘์ ์„ ๋‘๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ํ˜ธ์ด์ŠคํŒ…(hoisting) Hoisting์€ hoist๋ผ๋Š” ๋‹จ์–ด์—์„œ ์ถœ๋ฐœํ•ฉ๋‹ˆ๋‹ค. โ€œ๋Œ์–ด ์˜ฌ๋ฆฌ๋Š” ์žฅ์น˜โ€, โ€œ๋Œ์–ด ์˜ฌ๋ฆฌ๊ธฐโ€๋ผ๋Š” ๋œป์ž…๋‹ˆ๋‹ค. ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ์—์„œ๋„ ํ˜ธ์ด์ŠคํŒ…์€ ๋งˆ์ฐฌ๊ฐ€์ง€๋กœ ๋Œ์–ด ์˜ฌ๋ฆฐ๋‹ค๋Š” ๊ฒƒ์ด ํฌ์ธํŠธ์ž…๋‹ˆ๋‹ค. ๊ทธ๋ ‡๋‹ค๋ฉด ๋Œ์–ด์˜ฌ๋ ค์ง€๋Š” ๊ฒƒ์€ ๋ฌด์—‡์ผ๊นŒ์š”? ๋ฐ”๋กœ ๋ณ€์ˆ˜(Variable)์ž…๋‹ˆ๋‹ค. ๊ฐ„๋‹จํ•˜๊ฒŒ ๋งํ•ด์„œ JavaScript์—์„œ์˜ ํ˜ธ์ด์ŠคํŒ…์˜ ์˜๋ฏธ๋Š” ๋ณ€์ˆ˜ ์„ ์–ธ๋ฌธ์„ ๋Œ์–ด์˜ฌ๋ฆฐ๋‹ค๋Š” ๋œป์œผ๋กœ ์ดํ•ดํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹ค. ์ข€ ๋” ์ดํ•ด๋ฅผ ๋•๊ธฐ์œ„ํ•ด ์•„๋ž˜์˜ ์ฝ”๋“œ๋ฅผ ์ค€๋น„ํ–ˆ์Šต๋‹ˆ๋‹ค. ์œ„์˜ ์ฝ”๋“œ๋Š” ํ˜ธ์ด์ŠคํŒ…์„ ์„ค๋ช…ํ•˜๊ธฐ ์œ„ํ•œ ๊ฐ„๋‹จํ•œ ์˜ˆ์ œ์ž…๋‹ˆ๋‹ค. ์œ„ ์ฝ”๋“œ๋ฅผ ๋ณด์‹œ..

2016.09.19 ๊ฒŒ์‹œ๋จ

 ํฌ์ŠคํŒ… ์ธ๋„ค์ผ ์ด๋ฏธ์ง€

๊ฐœ๋ฐœ/Javascript

[์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ] ๋ฐฐ์—ด ์š”์†Œ ์ค‘ ์ตœ๋Œ€๊ฐ’ ์ตœ์†Œ๊ฐ’ ์ฐพ๊ธฐ

์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ์—๋Š” ์ˆซ์ž๋กœ ์ด๋ฃจ์–ด์ง„ ๋ฐฐ์—ด ๋‚ด์—์„œ ๊ฐ€์žฅ ํฐ ์ˆซ์ž ํ˜น์€ ๊ฐ€์žฅ ์ž‘์€ ์ˆซ์ž๋ฅผ ์ฐพ์•„์•ผ ํ•  ๊ฒฝ์šฐ for๋ฌธ์„ ๋Œ๋ฆฌ๋Š” ๋‹จ์ˆœํ•œ ๋ฐฉ๋ฒ• ์™ธ์— ๋” ๊ฐ„๋‹จํ•œ ๋ฐฉ๋ฒ•์ด ์กด์žฌํ•ฉ๋‹ˆ๋‹ค! ๋จผ์ € Math ๊ฐ์ฒด๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๋ฐฉ๋ฒ•์ด ์žˆ์Šต๋‹ˆ๋‹ค. Math ๊ฐ์ฒด์— ๊ฐ€์žฅ ํฐ ์ˆซ์ž, ๊ฐ€์žฅ ์ž‘์€ ์ˆซ์ž๋ฅผ ๊ตฌํ•˜๋Š” max, min ๋ฉ”์„œ๋“œ๊ฐ€ ์กด์žฌํ•˜๋Š”๋ฐ ์—ฌ๊ธฐ์— apply ๋ฉ”์„œ๋“œ๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ์ˆซ์ž๋กœ ์ด๋ฃจ์–ด์ง„ ๋ฐฐ์—ด์„ ํŒŒ๋ผ๋ฏธํ„ฐ๋กœ ์ „๋‹ฌํ•  ์ˆ˜ ์žˆ๊ฒŒ ๋ฉ๋‹ˆ๋‹ค. ์•„๋ž˜์˜ ์˜ˆ์‹œ๋ฅผ ๋ณด๋ฉด ์ดํ•ดํ•˜๊ธฐ ์‰ฌ์šธ๊ฒ๋‹ˆ๋‹ค. ํ•œ ๊ฐ€์ง€ ์กฐ์‹ฌํ•ด์•ผํ•  ๋ถ€๋ถ„์ด ์žˆ๋Š”๋ฐ, ๋ฐฐ์—ด ๋‚ด์— ๋น„๊ต ๋ถˆ๊ฐ€๋Šฅํ•œ ๊ฐ’์ด ์žˆ๋‹ค๋ฉด ๊ฒฐ๊ณผ๋Š” NaN์œผ๋กœ ๋‚˜์˜ค๊ฒŒ ๋จ์„ ์ฃผ์˜ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

2016.09.18 ๊ฒŒ์‹œ๋จ

 ํฌ์ŠคํŒ… ์ธ๋„ค์ผ ์ด๋ฏธ์ง€

Computer science/์•Œ๊ณ ๋ฆฌ์ฆ˜

[์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ๋กœ ๊ตฌํ˜„ํ•œ ์•Œ๊ณ ๋ฆฌ์ฆ˜] Highest and Lowest

In this little assignment you are given a string of space separated numbers, and have to return the highest and lowest number.Example:highAndLow("1 2 3 4 5"); // return "5 1"highAndLow("1 2 -3 4 5"); // return "5 -3"highAndLow("1 9 3 4 -5"); // return "9 -5" Notes:ยท All numbers are valid Int32, no need to validate them.ยท There will always be at least one number in the input string. ยท Output stri..

2016.09.18 ๊ฒŒ์‹œ๋จ

 ํฌ์ŠคํŒ… ์ธ๋„ค์ผ ์ด๋ฏธ์ง€

Computer science/์•Œ๊ณ ๋ฆฌ์ฆ˜

[์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ๋กœ ๊ตฌํ˜„ํ•œ ์•Œ๊ณ ๋ฆฌ์ฆ˜] Complementary DNA

Description: Deoxyribonucleic acid (DNA) is a chemical found in the nucleus of cells and carries the "instructions" for the development and functioning of living organisms. If you want to know more http://en.wikipedia.org/wiki/DNA In DNA strings, symbols "A" and "T" are complements of each other, as "C" and "G". You have function with one side of the DNA (string, except for Haskell); you need to..

2016.09.17 ๊ฒŒ์‹œ๋จ

 ํฌ์ŠคํŒ… ์ธ๋„ค์ผ ์ด๋ฏธ์ง€

Computer science/์•Œ๊ณ ๋ฆฌ์ฆ˜

[์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ๋กœ ๊ตฌํ˜„ํ•œ ์•Œ๊ณ ๋ฆฌ์ฆ˜] Stringy Strings

Description: write me a function stringy that takes a size and returns a string of alternating '1s' and '0s'. the string should start with a 1. a string with size 6 should return :'101010'. with size 4 should return : '1010'. with size 12 should return : '101010101010'. The size will always be positive and will only use whole numbers.

2016.09.17 ๊ฒŒ์‹œ๋จ

 ํฌ์ŠคํŒ… ์ธ๋„ค์ผ ์ด๋ฏธ์ง€

Computer science/์•Œ๊ณ ๋ฆฌ์ฆ˜

[์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ๋กœ ๊ตฌํ˜„ํ•œ ์•Œ๊ณ ๋ฆฌ์ฆ˜] Disemvowel Trolls

Trolls are attacking your comment section! A common way to deal with this situation is to remove all of the vowels from the trolls' comments, neutralizing the threat. Your task is to write a function that takes a string and return a new string with all vowels removed. For example, the string "This website is for losers LOL!" would become "Ths wbst s fr lsrs LL!". ๋ชจ์Œ๋งŒ ์ œ๊ฑฐํ•˜๋Š” ์˜ˆ์ œ๋‹ค. ์ •๊ทœํ‘œํ˜„์‹ /[aeiou]/ gi..

2016.09.17 ๊ฒŒ์‹œ๋จ

 ํฌ์ŠคํŒ… ์ธ๋„ค์ผ ์ด๋ฏธ์ง€

Computer science/์•Œ๊ณ ๋ฆฌ์ฆ˜

[์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ๋กœ ๊ตฌํ˜„ํ•œ ์•Œ๊ณ ๋ฆฌ์ฆ˜] Beginner Series #3 Sum of Numbers

Given two integers, which can be positive and negative, find the sum of all the numbers between including them too and return it. If both numbers are equal return a or b. Note! a and b are not ordered! Example: GetSum(1, 0) == 1 // 1 + 0 = 1 GetSum(1, 2) == 3 // 1 + 2 = 3 GetSum(0, 1) == 1 // 0 + 1 = 1 GetSum(1, 1) == 1 // 1 Since both are same GetSum(-1, 0) == -1 // -1 + 0 = -1 GetSum(-1, 2) ==..

2016.09.17 ๊ฒŒ์‹œ๋จ

 ํฌ์ŠคํŒ… ์ธ๋„ค์ผ ์ด๋ฏธ์ง€

Computer science/์•Œ๊ณ ๋ฆฌ์ฆ˜

[์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ๋กœ ๊ตฌํ˜„ํ•œ ์•Œ๊ณ ๋ฆฌ์ฆ˜] Return Negative

In this simple assignment you are given a number and have to make it negative. But maybe the number is already negative? Example: makeNegative(1); // return -1 makeNegative(-5); // return -5 makeNegative(0); // return 0 Notes: The number can be negative already, in which case no change is required. Zero (0) can't be negative, see examples above.

2016.09.17 ๊ฒŒ์‹œ๋จ

 ํฌ์ŠคํŒ… ์ธ๋„ค์ผ ์ด๋ฏธ์ง€

Computer science/์•Œ๊ณ ๋ฆฌ์ฆ˜

[์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ๋กœ ๊ตฌํ˜„ํ•œ ์•Œ๊ณ ๋ฆฌ์ฆ˜] Convert number to reversed array of digits

Description: Convert number to reversed array of digits Given a random number: C#: long; C++: unsigned long; You have to return the digits of this number within an array in reverse order. Example: 348597 => [7,9,5,8,4,3] ํ›จ์”ฌ ๋” ์ƒ์‚ฐ์ ์ธ ์ฝ”๋“œ๋กœ ๊ฐœ์„ ํ•˜์ž๋ฉด ๋งŽ์ด ๋ฐฐ์›Œ๊ฐ‘๋‹ˆ๋‹ค.

2016.09.14 ๊ฒŒ์‹œ๋จ

728x90
๋ฐ˜์‘ํ˜•