๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
Algorithm

ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค[Java] - ๋ฒ ์ŠคํŠธ์•จ๋ฒ”(ํ•ด์‹œ)

by ์ฃผ๋ฐœ2 2021. 6. 4.
๋ฐ˜์‘ํ˜•

https://programmers.co.kr/learn/courses/30/lessons/42579

 

์ฝ”๋”ฉํ…Œ์ŠคํŠธ ์—ฐ์Šต - ๋ฒ ์ŠคํŠธ์•จ๋ฒ”

์ŠคํŠธ๋ฆฌ๋ฐ ์‚ฌ์ดํŠธ์—์„œ ์žฅ๋ฅด ๋ณ„๋กœ ๊ฐ€์žฅ ๋งŽ์ด ์žฌ์ƒ๋œ ๋…ธ๋ž˜๋ฅผ ๋‘ ๊ฐœ์”ฉ ๋ชจ์•„ ๋ฒ ์ŠคํŠธ ์•จ๋ฒ”์„ ์ถœ์‹œํ•˜๋ ค ํ•ฉ๋‹ˆ๋‹ค. ๋…ธ๋ž˜๋Š” ๊ณ ์œ  ๋ฒˆํ˜ธ๋กœ ๊ตฌ๋ถ„ํ•˜๋ฉฐ, ๋…ธ๋ž˜๋ฅผ ์ˆ˜๋กํ•˜๋Š” ๊ธฐ์ค€์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค. ์†ํ•œ ๋…ธ๋ž˜๊ฐ€

programmers.co.kr

 

 

ํ‹€๋ฆฐ ์ฝ”๋“œ

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

class Solution {
    public static int[] solution(String[] genres, int[] plays) {
        List<Integer> list = new ArrayList<>();
        int length = genres.length;
        Map<String, Integer> map = getSumOfGenres(genres, plays);
        Album[] albums = getAlbums(genres, plays, map);

        // 1) ์žฌ์ƒ ๋…ธ๋ž˜ ํšŸ์ˆ˜๊ฐ€ ๊ฐ™์„๊ฒฝ์šฐ => ๊ณ ์œ  ๋ฒˆํ˜ธ๊ฐ€ ๋‚ฎ์€ ์ˆœ์œผ๋กœ ์˜ค๋ฆ„์ฐจ์ˆœ
        // 2) ์žฌ์ƒ๋œ ์žฅ๋ฅด ์ˆ˜๊ฐ€ ๊ฐ™์„๊ฒฝ์šฐ => ์žฌ์ƒ ๋…ธ๋ž˜ ํšŸ์ˆ˜ ์ˆœ ๋‚ด๋ฆผ์ฐจ์ˆœ
        // * ์žฌ์ƒ๋œ ์žฅ๋ฅด ์ˆ˜ -> ์žฅ๋ฅด ๋‚ด์—์„œ ์žฌ์ƒ๋œ ๋…ธ๋ž˜ ํšŸ์ˆ˜ -> ๋…ธ๋ž˜ ๋ณ„ ๊ณ ์œ  ๋ฒˆํ˜ธ(index) ์ˆœ
        Arrays.sort(albums, (i1, i2) -> {
            if (i2.sum == i1.sum) {
                if (i2.plays == i1.plays) {
                    return Integer.compare(i1.index, i2.index);
                }
                return Integer.compare(i2.plays, i1.plays);
            }
            return Integer.compare(i2.sum, i1.sum);
        });

        int count = 1;
        list.add(albums[0].index);
        
        // ์ž˜๋ชป๋œ ๋กœ์ง !!
        for (int i = 1; i < length; i++) {
            if (count == 2) {
                if (albums[i].genres.equals(albums[i - 1].genres)) continue;
                else count = 0;
            }

            list.add(albums[i].index);
            count ++;
        }
        return list.stream().mapToInt(Integer::intValue).toArray();
    }

    private static Album[] getAlbums(String[] genres, int[] plays, Map<String, Integer> map) {
        Album[] albums = new Album[genres.length];

        for (int i = 0; i < genres.length; i++) {
            Album album = new Album(genres[i], plays[i], map.get(genres[i]), i);
            albums[i] = album;
        }
        return albums;
    }

    private static Map<String, Integer> getSumOfGenres(String[] genres, int[] plays) {
        Map<String, Integer> map = new HashMap<>();
        for (int i = 0; i < genres.length; i++) {
            map.put(genres[i], map.getOrDefault(genres[i], 0) + plays[i]);
        }
        return map;
    }

    static class Album {
        String genres;
        int plays;
        int sum;
        int index;

        private Album() {
        }

        public Album(String genres, int plays, int sum, int index) {
            this.genres = genres;
            this.plays = plays;
            this.sum = sum;
            this.index = index;
        }

        @Override
        public String toString() {
            return "Album{" +
                    "genres='" + genres + '\'' +
                    ", plays=" + plays +
                    ", sum=" + sum +
                    ", index=" + index +
                    '}';
        }
    }
}

 

์œ„ ์ฝ”๋“œ๋Š”  ํ…Œ์ŠคํŠธ์ผ€์ด์Šค 9๋ฒˆ๋งŒ ์‹คํŒจํ•˜๋Š”๋ฐ, ์ •ํ™•ํ•œ ๋ฐ˜๋ก€๋ฅผ ์ฐพ์ง€ ๋ชปํ–ˆ์ง€๋งŒ ๋‹ค์Œ๊ณผ ๊ฐ™์€ ํ…Œ์ŠคํŠธ์ผ€์ด์Šค์—์„œ ๋ฌธ์ œ๊ฐ€ ์žˆ์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

genre = 'a', 'b', 'c', 'd', 'e'

 

์ฆ‰, ์žฅ๋ฅด๋Š” ๋ชจ๋‘ ๋‹ค๋ฅด์ง€๋งŒ ์œ„ ๋กœ์ง์—์„œ๋Š” count == 2 ์ผ๋•Œ๋งŒ if๋ฌธ์„ ํƒ„ ๋’ค ์ด์ „์— ์ถœ์‹œํ•œ ์žฅ๋ฅด์™€ ํ˜„์žฌ ์ถœ์‹œํ•œ ์žฅ๋ฅด๋ฅผ ๋น„๊ตํ•˜๊ธฐ ๋•Œ๋ฌธ์—

์ด๋Ÿฌํ•œ ๋ถ€๋ถ„์—์„œ ์‹คํŒจํ•˜๋Š” ์ผ€์ด์Šค๊ฐ€ ์กด์žฌํ• ๊ฑฐ๋ผ๊ณ  ์ƒ๊ฐ์„ ํ–ˆ์Šต๋‹ˆ๋‹ค!

 

 

 

์ •๋‹ต ์ฝ”๋“œ

package kit.hash;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

// TODO:
public class ๋ฒ ์ŠคํŠธ์•จ๋ฒ” {
    public static int[] solution(String[] genres, int[] plays) {
        List<Integer> list = new ArrayList<>();
        int length = genres.length;
        Map<String, Integer> map = getSumOfGenres(genres, plays);
        Album[] albums = getAlbums(genres, plays, map);

        // 1) ์žฌ์ƒ ๋…ธ๋ž˜ ํšŸ์ˆ˜๊ฐ€ ๊ฐ™์„๊ฒฝ์šฐ => ๊ณ ์œ  ๋ฒˆํ˜ธ๊ฐ€ ๋‚ฎ์€ ์ˆœ์œผ๋กœ ์˜ค๋ฆ„์ฐจ์ˆœ
        // 2) ์žฌ์ƒ๋œ ์žฅ๋ฅด ์ˆ˜๊ฐ€ ๊ฐ™์„๊ฒฝ์šฐ => ์žฌ์ƒ ๋…ธ๋ž˜ ํšŸ์ˆ˜ ์ˆœ ๋‚ด๋ฆผ์ฐจ์ˆœ
        // * ์žฌ์ƒ๋œ ์žฅ๋ฅด ์ˆ˜(์˜ค๋ฆ„์ฐจ์ˆœ) -> ์žฅ๋ฅด ๋‚ด์—์„œ ์žฌ์ƒ๋œ ๋…ธ๋ž˜ ํšŸ์ˆ˜(์˜ค๋ฆ„์ฐจ์ˆœ) -> ๋…ธ๋ž˜ ๋ณ„ ๊ณ ์œ  ๋ฒˆํ˜ธ(๋‚ด๋ฆผ์ฐจ์ˆœ)
        Arrays.sort(albums, (i1, i2) -> {
            if (i2.sum == i1.sum) {
                if (i2.plays == i1.plays) {
                    return Integer.compare(i1.index, i2.index);
                }
                return Integer.compare(i2.plays, i1.plays);
            }
            return Integer.compare(i2.sum, i1.sum);
        });

        for (int i = 0; i < length; i++) {
            System.out.println(albums[i].toString());
        }

        int count = 1;
        list.add(albums[0].index);
        for (int i = 1; i < length; i++) {
            if (count == 2 && albums[i].genres.equals(albums[i - 1].genres)) {
                continue;
            }
            if (!albums[i].genres.equals(albums[i - 1].genres)) {
                count = 0;
            }

            list.add(albums[i].index);
            count ++;
        }
        return list.stream().mapToInt(Integer::intValue).toArray();
    }

    private static Album[] getAlbums(String[] genres, int[] plays, Map<String, Integer> map) {
        Album[] albums = new Album[genres.length];

        for (int i = 0; i < genres.length; i++) {
            Album album = new Album(genres[i], plays[i], map.get(genres[i]), i);
            albums[i] = album;
        }
        return albums;
    }

    private static Map<String, Integer> getSumOfGenres(String[] genres, int[] plays) {
        Map<String, Integer> map = new HashMap<>();
        for (int i = 0; i < genres.length; i++) {
            map.put(genres[i], map.getOrDefault(genres[i], 0) + plays[i]);
        }
        return map;
    }

    static class Album {
        String genres;
        int plays;
        int sum;
        int index;

        private Album() {
        }

        public Album(String genres, int plays, int sum, int index) {
            this.genres = genres;
            this.plays = plays;
            this.sum = sum;
            this.index = index;
        }

        @Override
        public String toString() {
            return "Album{" +
                    "genres='" + genres + '\'' +
                    ", plays=" + plays +
                    ", sum=" + sum +
                    ", index=" + index +
                    '}';
        }
    }

    public static void main(String[] args) {
        String[] genres = {"c", "a", "b", "a", "a", "b", "b", "b", "b", "c", "c", "c", "d"};
        int[] plays = {1, 500, 9, 600, 501, 800, 500, 300, 2, 2, 1, 2, 100000};

        int[] result = solution(genres, plays);
        System.out.println(Arrays.toString(result));
    }
}

 

 

ํ’€์ด

๋ฌธ์ œ์—์„œ ๋…ธ๋ž˜๋Š” ๊ณ ์œ  ๋ฒˆํ˜ธ๋กœ ๊ตฌ๋ถ„ํ•˜๋ฉฐ, ๋…ธ๋ž˜๋ฅผ ์ˆ˜๋กํ•˜๋Š” ๊ธฐ์ค€์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค. ๋ผ๊ณ  ๋ช…์‹œ๋˜์–ด ์žˆ๋Š” ๋ถ€๋ถ„์ด ์ด ๋ฌธ์ œ์˜ ํ•ต์‹ฌ์ž…๋‹ˆ๋‹ค.

  • ์†ํ•œ ๋…ธ๋ž˜๊ฐ€ ๋งŽ์ด ์žฌ์ƒ๋œ ์žฅ๋ฅด๋ฅผ ๋จผ์ € ์ˆ˜๋กํ•ฉ๋‹ˆ๋‹ค.
  • ์žฅ๋ฅด ๋‚ด์—์„œ ๋งŽ์ด ์žฌ์ƒ๋œ ๋…ธ๋ž˜๋ฅผ ๋จผ์ € ์ˆ˜๋กํ•ฉ๋‹ˆ๋‹ค.
  • ์žฅ๋ฅด ๋‚ด์—์„œ ์žฌ์ƒ ํšŸ์ˆ˜๊ฐ€ ๊ฐ™์€ ๋…ธ๋ž˜ ์ค‘์—์„œ๋Š” ๊ณ ์œ  ๋ฒˆํ˜ธ๊ฐ€ ๋‚ฎ์€ ๋…ธ๋ž˜๋ฅผ ๋จผ์ € ์ˆ˜๋กํ•ฉ๋‹ˆ๋‹ค.

 

์œ„ ๊ธฐ์ค€์— ๋”ฐ๋ผ ์ ๋‹นํžˆ ์ •๋ ฌ ์กฐ๊ฑด์„ ๋ช…์‹œํ•˜๋ฉด์„œ ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•ด๋‚˜๊ฐ€๋ฉด ๋  ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

 

์ €๋Š” ์•„๋ž˜์™€ ๊ฐ™์ด ์ •๋ ฌ์„ ๊ธฐ๋Œ€ํ•˜๊ณ  ๋ฌธ์ œ๋ฅผ ์ ‘๊ทผํ–ˆ๋Š”๋ฐ์š”,

 

1) ์†ํ•œ ๋…ธ๋ž˜๊ฐ€ ๋งŽ์ด ์žฌ์ƒ๋œ ์žฅ๋ฅด(sum)๋ฅผ ๋จผ์ € ์ˆ˜๋กํ•ฉ๋‹ˆ๋‹ค. (๋‚ด๋ฆผ์ฐจ์ˆœ)

  • ๊ฐ ์žฅ๋ฅด๋ณ„ ์ด ์žฌ์ƒ๋œ ํšŸ์ˆ˜๋ฅผ ๊ตฌํ•ฉ๋‹ˆ๋‹ค.

 

2) ์žฅ๋ฅด(genres) ๋‚ด์—์„œ ๋งŽ์ด ์žฌ์ƒ๋œ ๋…ธ๋ž˜(plays)๋ฅผ ๋จผ์ € ์ˆ˜๋กํ•ฉ๋‹ˆ๋‹ค. (๋‚ด๋ฆผ์ฐจ์ˆœ)

  • 1)์—์„œ ์กฐ๊ฑด์ด ๋™์ผํ•  ๊ฒฝ์šฐ, ๋งŽ์ด ์žฌ์ƒ๋œ ๋…ธ๋ž˜ ์ˆœ์œผ๋กœ ์ •๋ ฌ์„ ํ•ฉ๋‹ˆ๋‹ค.

 

3) ์žฅ๋ฅด ๋‚ด์—์„œ ์žฌ์ƒ ํšŸ์ˆ˜(plays)๊ฐ€ ๊ฐ™์€ ๋…ธ๋ž˜ ์ค‘์—์„œ๋Š” ๊ณ ์œ  ๋ฒˆํ˜ธ(index)๊ฐ€ ๋‚ฎ์€ ๋…ธ๋ž˜๋ฅผ ๋จผ์ € ์ˆ˜๋กํ•ฉ๋‹ˆ๋‹ค. (์˜ค๋ฆ„์ฐจ์ˆœ)

  • 1)์ด ๋™์ผํ•˜๊ณ , 2)์ด ๋™์ผํ•  ๊ฒฝ์šฐ -> ๊ณ ์œ  ๋ฒˆํ˜ธ(index)๊ฐ€ ๋‚ฎ์€ ๋…ธ๋ž˜ ์ˆœ์œผ๋กœ ์ •๋ ฌ์„ ํ•ฉ๋‹ˆ๋‹ค.

 

 

๋”ฐ๋ผ์„œ ์žฅ๋ฅด๋ช…๊ณผ ์œ„ 3๊ฐ€์ง€๋ฅผ ํ•„๋“œ๋กœ ๊ฐ€์ง€๋Š” Album ํด๋ž˜์Šค๋ฅผ inner class๋กœ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.

    static class Album {
        String genres;
        int plays;
        int sum;
        int index;

        private Album() {
        }

        public Album(String genres, int plays, int sum, int index) {
            this.genres = genres;
            this.plays = plays;
            this.sum = sum;
            this.index = index;
        }
    }

 

์•„๋ž˜์™€ ๊ฐ™์ด ์ •๋ ฌ์„ Album์—์„œ Comparable์„ implements ํ•œ ๋’ค ๊ตฌํ˜„ํ•ด๋„ ๋˜์ง€๋งŒ, ์ €๋Š” ์ต๋ช… ํด๋ž˜์Šค๋กœ ๊ตฌํ˜„์„ ํ–ˆ์Šต๋‹ˆ๋‹ค.

static class Album implements Comparable<Album> {
    ...
    
    @Override
    public int compareTo(Album o) {
        if (o.sum == this.sum) {
            if (o.plays == this.plays) {
                return Integer.compare(this.index, o.index);
            }
            return Integer.compare(o.plays, this.plays);
        }
        return Integer.compare(o.sum, this.sum);
    }
}

 

 

๊ทธ ํ›„ ์œ„์—์„œ ์„ค๋ช…๋“œ๋ฆฐ 1) ~ 3) ํ’€์ด์— ๋Œ€ํ•ด ๊ฐ„๋žตํžˆ ์‚ดํŽด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค.

 

 

1) ์†ํ•œ ๋…ธ๋ž˜๊ฐ€ ๋งŽ์ด ์žฌ์ƒ๋œ ์žฅ๋ฅด๋ฅผ ๋จผ์ € ์ˆ˜๋กํ•ฉ๋‹ˆ๋‹ค. (๋‚ด๋ฆผ์ฐจ์ˆœ)

  • ๊ฐ ์žฅ๋ฅด๋ณ„ ์ด ์žฌ์ƒ๋œ ํšŸ์ˆ˜๋ฅผ ๊ตฌํ•ฉ๋‹ˆ๋‹ค.

์ €๋Š” Map<String, Integer>์œผ๋กœ ์žฅ๋ฅด๋ช…๊ณผ ์žฅ๋ฅด๋ณ„ ์ด ์žฌ์ƒ๋œ ํšŸ์ˆ˜๋ฅผ ๊ณ„์‚ฐํ–ˆ์Šต๋‹ˆ๋‹ค.

    Map<String, Integer> map = getSumOfGenres(genres, plays);

    private static Map<String, Integer> getSumOfGenres(String[] genres, int[] plays) {
        Map<String, Integer> map = new HashMap<>();
        for (int i = 0; i < genres.length; i++) {
            map.put(genres[i], map.getOrDefault(genres[i], 0) + plays[i]);
        }
        return map;
    }

 

 

 

2) ์žฅ๋ฅด ๋‚ด์—์„œ ๋งŽ์ด ์žฌ์ƒ๋œ ๋…ธ๋ž˜๋ฅผ ๋จผ์ € ์ˆ˜๋กํ•ฉ๋‹ˆ๋‹ค. (๋‚ด๋ฆผ์ฐจ์ˆœ)

  • 1)์—์„œ ์กฐ๊ฑด์ด ๋™์ผํ•  ๊ฒฝ์šฐ, ๋งŽ์ด ์žฌ์ƒ๋œ ๋…ธ๋ž˜ ์ˆœ์œผ๋กœ ์ •๋ ฌ์„ ํ•ฉ๋‹ˆ๋‹ค.

 

3) ์žฅ๋ฅด ๋‚ด์—์„œ ์žฌ์ƒ ํšŸ์ˆ˜๊ฐ€ ๊ฐ™์€ ๋…ธ๋ž˜ ์ค‘์—์„œ๋Š” ๊ณ ์œ  ๋ฒˆํ˜ธ๊ฐ€ ๋‚ฎ์€ ๋…ธ๋ž˜๋ฅผ ๋จผ์ € ์ˆ˜๋กํ•ฉ๋‹ˆ๋‹ค. (์˜ค๋ฆ„์ฐจ์ˆœ)

  • 1)์ด ๋™์ผํ•˜๊ณ , 2)์ด ๋™์ผํ•  ๊ฒฝ์šฐ -> ๊ณ ์œ  ๋ฒˆํ˜ธ(index)๊ฐ€ ๋‚ฎ์€ ๋…ธ๋ž˜ ์ˆœ์œผ๋กœ ์ •๋ ฌ์„ ํ•ฉ๋‹ˆ๋‹ค.

์œ„ ๋ฌธ์ œ์— ๋Œ€ํ•œ ์ •๋ ฌ์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

        // 1) ์žฌ์ƒ ๋…ธ๋ž˜ ํšŸ์ˆ˜๊ฐ€ ๊ฐ™์„๊ฒฝ์šฐ => ๊ณ ์œ  ๋ฒˆํ˜ธ๊ฐ€ ๋‚ฎ์€ ์ˆœ์œผ๋กœ ์˜ค๋ฆ„์ฐจ์ˆœ
        // 2) ์žฌ์ƒ๋œ ์žฅ๋ฅด ์ˆ˜๊ฐ€ ๊ฐ™์„๊ฒฝ์šฐ => ์žฌ์ƒ ๋…ธ๋ž˜ ํšŸ์ˆ˜ ์ˆœ ๋‚ด๋ฆผ์ฐจ์ˆœ
        // * ์žฌ์ƒ๋œ ์žฅ๋ฅด ์ˆ˜(์˜ค๋ฆ„์ฐจ์ˆœ) -> ์žฅ๋ฅด ๋‚ด์—์„œ ์žฌ์ƒ๋œ ๋…ธ๋ž˜ ํšŸ์ˆ˜(์˜ค๋ฆ„์ฐจ์ˆœ) -> ๋…ธ๋ž˜ ๋ณ„ ๊ณ ์œ  ๋ฒˆํ˜ธ(๋‚ด๋ฆผ์ฐจ์ˆœ)
        Arrays.sort(albums, (i1, i2) -> {
            if (i2.sum == i1.sum) {
                if (i2.plays == i1.plays) {
                    return Integer.compare(i1.index, i2.index);
                }
                return Integer.compare(i2.plays, i1.plays);
            }
            return Integer.compare(i2.sum, i1.sum);
        });

 

 

๋งˆ์ง€๋ง‰์œผ๋กœ ๋…ธ๋ž˜๋Š” ๋‘ ๊ฐœ์”ฉ ๋ชจ์•„ ๋ฒ ์ŠคํŠธ ์•จ๋ฒ”์„ ์ถœ์‹œํ•˜๊ธฐ ๋•Œ๋ฌธ์— ๋‹ค์Œ๊ณผ ๊ฐ™์ด ๊ตฌํ˜„์„ ํ–ˆ์Šต๋‹ˆ๋‹ค.

        for (int i = 1; i < length; i++) {
            if (count == 2 && albums[i].genres.equals(albums[i - 1].genres)) {
                continue;
            }
            if (!albums[i].genres.equals(albums[i - 1].genres)) {
                count = 0;
            }

            list.add(albums[i].index);
            count ++;
        }

์žฅ๋ฅด๋Š” ์ตœ๋Œ€ 2๊ฐœ๋งŒ ์ถœ์‹œ๋ฅผ ํ•ด์•ผํ•˜๊ธฐ ๋•Œ๋ฌธ์—, ์ „์— ์ถœ์‹œํ•œ ์žฅ๋ฅด์™€ ๋น„๊ต๋ฅผ ํ•ฉ๋‹ˆ๋‹ค.

 

๋งŒ์•ฝ, 2๊ฐœ๋ฅผ ์ถœ์‹œํ–ˆ๊ณ  ๋‹ค์Œ ์ถœ์‹œํ•˜๋ ค๋Š” ์žฅ๋ฅด๊ฐ€ ์ด์ „์— ์ถœ์‹œํ•œ ์žฅ๋ฅด์™€ ๋™์ผํ•  ๊ฒฝ์šฐ

  • ์ด ๊ฒฝ์šฐ ๋”์ด์ƒ ์ถœ์‹œ๋ฅผ ํ•˜์ง€ ์•Š๊ณ  for๋ฌธ์„ ๊ฑด๋„ˆ๋œ๋‹ˆ๋‹ค(continue)
  • ex) 'pop', 'pop', 'pop', 'pop' 

 

๋งŒ์•ฝ ์ด์ „์— ์ถœ์‹œํ•œ ์žฅ๋ฅด์™€ ํ˜„์žฌ ์ถœ์‹œํ•œ ์žฅ๋ฅด๊ฐ€ ๋‹ค๋ฅผ ๊ฒฝ์šฐ

  • ํ˜„์žฌ ์ถœ์‹œํ•˜๋ ค๋Š” ์žฅ๋ฅด๋ฅผ 0์œผ๋กœ ์ดˆ๊ธฐํ™”ํ•ฉ๋‹ˆ๋‹ค.
๋ฐ˜์‘ํ˜•

๋Œ“๊ธ€