Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Lily] 4-4w #40

Open
wants to merge 2 commits into
base: Lily
Choose a base branch
from
Open

[Lily] 4-4w #40

wants to merge 2 commits into from

Conversation

ahnlook
Copy link

@ahnlook ahnlook commented Apr 30, 2023

No description provided.

@ahnlook ahnlook added the PGS 프로그래머스 label Apr 30, 2023

for (let j = 0; j < words.length; j++) {
if (word === words[j]) {
answer += j

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

객체로 키, 값을 주는것만 생각하고 배열로 간단하게 인덱스 값으로 해당 words의 숫자를 주는 생각을 못했네요. 하드코딩 적어지고 심플하고 좋네요!

Comment on lines +66 to +67
let arr = answer.split(numbers[i])
answer = arr.join(i)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

와... 배열 메서드 활용 짱이네요.. join은 진짜 생각도 못했네


for (let i = 0; i <= t.length - len; i++) {
const numbers = t.slice(i, i + p.length)
if (+numbers <= +p) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

헉 Number 타입으로 바꿔주는 디테일 배워갑니다!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PGS 프로그래머스
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants