MapleStory Finger Point

โ˜… 574

ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค - java ์ ‘๋ฏธ์‚ฌ ๋ฐฐ์—ด

๐Ÿ’ก ์ง์ ‘ ํ‘ผ ์ฝ”๋“œ ๋จผ์ € ๊ทœ์น™์„ ์ฐพ๋Š”๊ฒŒ ์ค‘์š”ํ•˜๋‹ค!  ๊ทธ๋ฆฌ๊ณ  substring ํ•ด์ค„๋•Œ ๋๊ฐ’์€ ์ž๋™ -1 ๋˜๋ฏ€๋กœ๊ตณ์ด -1์„ ๋ง๋ถ™์ด์ง€ ์•Š์•„๋„ ๋œ๋‹ค๋Š” ์  !!  ๐Ÿ’ฌ ๋ฌธ์ž์—ด.substring(์ฒ˜์Œ,๋-1) => ๋ฌธ์ž์—ด ์ž˜๋ผ๋‚ด๊ธฐ ๐Ÿ’ฌ Arrays.sort()  => ๋ฐฐ์—ด ์˜ค๋ฆ„์ฐจ์ˆœ์œผ๋กœ ์ •๋ ฌ  (import java.util.Arrays;) import java.util.Arrays;class Solution { public String[] solution(String my_string) { String[] answer = new String[my_string.length()]; for (int i = 0 ; i

ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค - java ๋ฌธ์ž์—ด์˜ ๋’ค์˜ n๊ธ€์ž

๐Ÿ’ก ์ง์ ‘ ํ‘ผ ์ฝ”๋“œ์ด ์ฝ”๋“œ๋Š” ๋ฌธ์ž์—ด ์ธ๋ฑ์Šค๊ฐ€ 0๋ถ€ํ„ฐ ์‹œ์ž‘ํ•˜๋Š” ์ ๋งŒ ์ฃผ์˜ํ•ด์„œ ์ƒ๊ฐํ•ด์ค€๋‹ค. ์ „์ฒด๊ธธ์ด - N ์„ ํ•ด์ฃผ๋ฉด ์‹œ์ž‘์ธ๋ฑ์Šค ๊ฐ’์ด ๋‚˜์˜จ๋‹ค !class Solution { public String solution(String my_string, int n) { String answer = ""; for (int i = (my_string.length()) - n; i

ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค - java ๋ถ€๋ถ„ ๋ฌธ์ž์—ด ์ด์–ด ๋ถ™์—ฌ ๋ฌธ์ž์—ด ๋งŒ๋“ค๊ธฐ

๐Ÿ’ก ์ง์ ‘ ํ‘ผ ์ฝ”๋“œparts ์˜ 2์ฐจ์› ๋ฐฐ์—ด ์•ˆ์˜ [s,e] ๊ฐ’์„ ์ž˜ ๋ฝ‘์•„์„œ ์จ๋‚ด๊ธฐ๋งŒ ํ•˜๋ฉด ๋œ๋‹ค!์ฃผ์˜ํ•  ์ ์€ substring ์€ "๋ฌธ์ž์—ด์—์„œ ์ธ๋ฑ์Šค 0๋ถ€ํ„ฐ ์ธ๋ฑ์Šค 5 ๋ฐ”๋กœ ์ด์ „๊นŒ์ง€์˜ ๋ถ€๋ถ„ ๋ฌธ์ž์—ด" ์ž„์„ ์ฃผ์˜ํ•ด์„œ  +1 ์„ ํ•ด์ค˜์•ผํ•œ๋‹ค! ๐Ÿ’ฌ ๋ฌธ์ž์—ด.substring(์ฒ˜์Œ,๋-1) => ๋ฌธ์ž์—ด ์ž˜๋ผ๋‚ด๊ธฐ class Solution { public String solution(String[] my_strings, int[][] parts) { String answer = ""; for (int i = 0; i

ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค - java ๋ฐฐ์—ด ๋งŒ๋“ค๊ธฐ 5

๐Ÿ’ก ์ง์ ‘ ํ‘ผ ์ฝ”๋“œ๋งˆ์ง€๋ง‰ ์กฐ๊ฑด์— ๋งž๋Š”  tmp ๊ฐ’์„ answer ์— ๋„ฃ์–ด์ฃผ๋Š”๋ฐ ์ž๊พธ 0 ์ด ๋‚˜์˜ค๋Š” ๊ฒƒ์ด๋‹ค ๐Ÿ˜…์ž๋ฐ” ์ผ๋ฐ˜ ๋ฐฐ์—ด์€ ํฌ๊ธฐ์— ๋งž๊ฒŒ ์ž๋™์œผ๋กœ 0์œผ๋กœ ์ดˆ๊ธฐํ™”๋˜๋Š” ํŠน์ง•๋•Œ๋ฌธ์— ๋™์ ๋ฐฐ์—ด์„ ์‚ฌ์šฉํ•ด์ฃผ์—ˆ๋‹ค!  ๐Ÿ’ฌ Integer.parseInt()  => ๋ฌธ์ž์—ด > ์ •์ˆ˜๋กœ ๋ณ€ํ™˜๐Ÿ’ฌ ๋ฌธ์ž์—ด.substring(์ฒ˜์Œ,๋-1) => ๋ฌธ์ž์—ด ์ž˜๋ผ๋‚ด๊ธฐ import java.util.ArrayList;class Solution { public ArrayList solution(String[] intStrs, int k, int s, int l) { ArrayList answer = new ArrayList(); int tmp = 0; for (int i = 0; i

#11005 ์ง„๋ฒ• ๋ณ€ํ™˜ 2- python

๐Ÿ’ก 10์ง„์ˆ˜ -> N์ง„์ˆ˜ ๋ณ€ํ™˜๋ฒ•    ๐Ÿ’ก 10์ง„์ˆ˜ -> N์ง„์ˆ˜ ๋ณ€ํ™˜๋ฒ•์„ ์ฝ”๋“œ๋กœ ๋งŒ๋“ค๊ธฐ ์œ„ํ•ด ์•Œ์•„์•ผ ํ•  ๊ฒƒ N, B = map(int,input().split())str = [] arr = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"while N != 0: str.append(arr[N%B]) N = N // Bprint(*str[::-1], sep="") ๐Ÿ’ฌ arr[index] : ์ธ๋ฑ์Šค๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ํ•ด๋‹น ์œ„์น˜์˜ ์š”์†Œ๋ฅผ ์„ ํƒํ•œ๋‹ค.๐Ÿ’ฌ str[::-1] : ๋ฆฌ์ŠคํŠธ๋‚˜ ๋ฌธ์ž์—ด์„ ๊ฑฐ๊พธ๋กœ ๋’ค์ง‘๋Š”๋‹ค.๐Ÿ’ฌ append() : ๋ฆฌ์ŠคํŠธ์— ์ƒˆ๋กœ์šด ์š”์†Œ๋ฅผ ์ถ”๊ฐ€ํ•˜๋Š” ๋ฉ”์„œ๋“œ  ๐Ÿ’ก ์ง„๋ฒ• ๋ณ€ํ™˜ 2 ์ƒ์„ธ์„ค๋ช… !! 0)  10์ง„์ˆ˜๋Š” 0~9 ๋ฅผ ์‚ฌ์šฉํ•˜์ง€๋งŒ , 16์ง„์ˆ˜๋Š” 0~ F ๊นŒ์ง€ , 36์ง„์ˆ˜..

#2745 ์ง„๋ฒ• ๋ณ€ํ™˜ - python

N, B = input().split()result = 0N= N[::-1]ary = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"for i in range (len(N)) : result += (int(B) ** i) * (ary.index(N[i])) print(result) ๐Ÿ’ก  B์ง„๋ฒ• ์ˆ˜  N ์„ 10์ง„์ˆ˜๋กœ ๋ณ€ํ™˜ํ•˜๋Š” ๋ฐฉ๋ฒ•๊ฐ ์ž๋ฆฌ๊ฐ’๊ณผ ๊ฐ€์ค‘์น˜๊ฐ’์„ ๊ณฑํ•ด์„œ b^0 b^1 b^2 ๋”ํ•œ๋‹ค    ๐Ÿ’ก ์ง„๋ฒ• ๋ณ€ํ™˜ ์ƒ์„ธ์„ค๋ช… !! 0)  10์ง„์ˆ˜๋Š” 0~9 ๋ฅผ ์‚ฌ์šฉํ•˜์ง€๋งŒ , 16์ง„์ˆ˜๋Š” 0~ F ๊นŒ์ง€ , 36์ง„์ˆ˜๋Š” 0~Z ๊นŒ์ง€์‚ฌ์šฉํ•˜๋ฏ€๋กœ arr ๋ฅผ ํ†ตํ•ด์„œ 0~Z๋ฅผ ๋ฏธ๋ฆฌ ์ง€์ •ํ•ด์ค€๋‹ค.1) ๊ฐ ์ž๋ฆฌ๊ฐ’์„ ์•Œ๊ธฐ ์œ„ํ•ด์„œ len (N) ์„ ํ†ตํ•ด์„œ ๊ธธ์ด๋ฅผ ์•Œ์•„๋‚ธ๋‹ค. 2) ๊ฐ ์ž๋ฆฌ ๊ฐ’ * ๊ฐ€์ค‘์น˜ ๊ฐ’  =>..

ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค - java ๋ฌธ์ž์—ด ์—ฌ๋Ÿฌ ๋ฒˆ ๋’ค์ง‘๊ธฐ

๋ฌธ์ œ๋ฅผ ์ž˜๋ชป์ดํ•ดํ•ด์„œ for ๋ฌธ์œผ๋กœ ์ง„ํ–‰ํ•ด๋ณด๋ ค๋‹ค๊ฐ€ ๋ง‰ํ˜”๋Š”๋ฐ์ธ๋ฑ์Šค s ~ ์ธ๋ฑ์Šค e๊นŒ์ง€ ์ „๋ถ€ ๋ฐ”๊พธ๋Š”๊ฑฐ๋‹ค.while ๋ฌธ์œผ๋กœ ํ•˜๋ฉด ์‰ฝ๊ฒŒ ๊ฐ€๋Šฅํ•˜๋‹ค.๋ฐ”๊ฟ”์ฃผ๊ณ  a++ b-- ํ•˜๋ฉฐ 1  5  / 2  4  ์ด๋Ÿฐ์‹์œผ๋กœ ๋ฐ”๊ฟ”์ค€๋‹ค.a๊ฐ€ b ๋ณด๋‹ค ์ž‘์„๋•Œ๊นŒ์ง€๋งŒ! ์ง„ํ–‰ํ•ด์ฃผ๋ฉด ๋จ!  class Solution { public String solution(String my_string, int[][] queries) { char[] num = my_string.toCharArray(); String answer = "" ; char tmp ; for (int i = 0; i

ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค - java 9๋กœ ๋‚˜๋ˆˆ ๋‚˜๋จธ์ง€

๐Ÿ’ก ์ง์ ‘ ํ‘ผ ์ฝ”๋“œ  ๐Ÿ’ฌ Character.getNumericValue()  : ์ฃผ์–ด์ง„ ๋ฌธ์ž์— ๋Œ€ํ•œ ์ˆซ์ž ๊ฐ’์„ ๋ฐ˜ํ™˜๐Ÿ’ฌ charAt()  ๋ฌธ์ž์—ด์—์„œ ํŠน์ • ์œ„์น˜์˜ ๋ฌธ์ž๋ฅผ ๊ฐ€์ ธ์˜จ๋‹ค. class Solution { public int solution(String number) { int answer = 0; for (int i=0; i