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

18-InSange #70

Merged
merged 2 commits into from
Jul 16, 2024
Merged

18-InSange #70

merged 2 commits into from
Jul 16, 2024

Conversation

InSange
Copy link
Collaborator

@InSange InSange commented Jul 10, 2024

πŸ”— 문제 링크

Crawler Log Folder

βœ”οΈ μ†Œμš”λœ μ‹œκ°„

15λΆ„

✨ μˆ˜λ„ μ½”λ“œ

풀이 방법

  1. Log 내역이 ../일 경우 ν˜„μž¬μ˜ 높이 값에 맞게 μ„€μ • - 0보닀 ν΄μ‹œμ— -1
  2. ./λŠ” μž‘μ„± λΆˆν•„μš”
  3. μ΄μ™Έμ˜ 값듀은 λͺ¨λ‘ 높이 증가
class Solution {
public:
    int minOperations(vector<string>& logs) {
        int height;
        
        height = 0;
        
        for(auto str : logs)
        {
            if(str[0] != '.') height++;
            else if(str == "../") height = (height ? height - 1 : 0);
        }
        
        return height;
    }
};

image

ν›„κΈ°

λ¦¬νŠΈμ½”λ“œμ—μ„œλŠ” 데일리 λ―Έμ…˜μ„ μ œκ³΅ν•΄μ€€λ‹€.
λ‚œμ΄λ„λŠ” 날에 따라 μ²œμ°¨λ§Œλ³„μΈλ° μ˜€λŠ˜μ€ μœ λ… μ‰¬μš΄ λ‚œμ΄λ„..?

πŸ“š μƒˆλ‘­κ²Œ μ•Œκ²Œλœ λ‚΄μš©

@yuyu0830
Copy link
Collaborator

문제 μ½μœΌλ €λ‹€ μ˜μ–΄λΌ 풀이 λ¨Όμ € λ΄€λŠ”λ° 풀이λ₯Ό λ³΄λ‹ˆκΉŒ λ¬Έμ œκ°€ 이해가 λ˜λ„€μš”..γ…‹γ…‹
'./' 에 λŒ€ν•΄μ„œλŠ” 처리λ₯Ό ν”Όν•˜λŠ” λΆ€λΆ„κΉŒμ§€ κΉ”λ”ν•˜λ„€μš”

Copy link
Collaborator

@yuyu0830 yuyu0830 left a comment

Choose a reason for hiding this comment

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

μ‹€μˆ˜λ‘œ μ½”λ©˜νŠΈλ‘œ λ‚¨κ²Όλ„€μš” γ…Žγ…Ž

Copy link
Collaborator

@seongwon030 seongwon030 left a comment

Choose a reason for hiding this comment

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

파일 계측을 κ³„μ‚°ν•˜λŠ” μ‹ κΈ°ν•œ λ¬Έμ œλ„€μš”. "./" λŠ” ꡳ이 계산할 ν•„μš”κ°€ μ—†μœΌλ‹ˆκΉŒ λ‚˜λ¨Έμ§€ λΆ€λΆ„λ§Œ κ³„μ‚°ν•˜λ„λ‘ ν•œ κ±°κ΅°μš”. 문제 잘 보고 κ°‘λ‹ˆλ‹€!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants