정렬

    [LeetCode] 1299. Replace Elements with Greatest Element on Right Side

    1299. Replace Elements with Greatest Element on Right Side Easy Given an array arr, replace every element in that array with the greatest element among the elements to its right, and replace the last element with -1. After doing so, return the array. Example 1: Input: arr = [17,18,5,4,6,1] Output: [18,6,6,6,1,-1] Explanation: - index 0 --> the greatest element to the right of index 0 is index 1 ..

    [LeetCode] 242. Valid Anagram

    242. Valid Anagram Easy Given two strings s and t, return true if t is an anagram of s, and false otherwise. An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once. Example 1: Input: s = "anagram", t = "nagaram" Output: true Example 2: Input: s = "rat", t = "car" Output: false Constraints: 1 bool: # ha..

    [LeetCode] 2225. Find Players With Zero or One Losses

    2225. Find Players With Zero or One Losses Medium You are given an integer array matches where matches[i] = [winneri, loseri] indicates that the player winneri defeated player loseri in a match. Return a list answer of size 2 where: answer[0] is a list of all players that have not lost any matches. answer[1] is a list of all players that have lost exactly one match. The values in the two lists s..