본문 바로가기

전체 글310

Kotlin] 안드로이드 스튜디오 AlertDialog 위치 Changing position of the Dialog on screen android I made a simple AlertDialog in my Activity: View view = layoutInflater.inflate(R.layout.my_dialog, null); AlertDialog infoDialog = new AlertDialog.Builder(MyActivity.this) .set... stackoverflow.com val alertDialog = builder.create() val window = alertDialog.window // 위쪽 window?.setGravity(Gravity.TOP) alertDialog.show() 전체코드 val builder = AlertDi.. 2020. 8. 8.
40] Leetcode 912. Sort an Array https://leetcode.com/problems/sort-an-array/ Sort an Array - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com class Solution { public: vector sortArray(vector& nums) { sort(nums.begin(), nums.end()); return nums; } }; ;;;; 2020. 8. 7.
39★] Leetcode 905. Sort Array By Parity Sort Array By Parity - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 짝수면 앞에 넣어주고, 홀수면 뒤에 넣어주면 된다. class Solution { public: vector sortArrayByParity(vector& A) { vectorans; for(int i = 0;i 2020. 8. 6.
38] Leetcode 961. N-Repeated Element in Size 2N Array N-Repeated Element in Size 2N Array - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com class Solution { public: int repeatedNTimes(vector& A) { int array[10001] = {0}; int ans = 0; for(int i = 0;i 2020. 8. 5.
37] Leetcode 1380. Lucky Numbers in a Matrix https://leetcode.com/problems/lucky-numbers-in-a-matrix/ Lucky Numbers in a Matrix - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 행에서 최소인 값 구하고 동시에 그 값의 열의 위치를 구한 후에 그 열에서 최대값이면 lucky class Solution { public: vector luckyNumbers (vector& matrix) { vectorans; int num = 10000000; .. 2020. 7. 21.
36] Leetcode 1460. Make Two Arrays Equal by Reversing Sub-arrays https://leetcode.com/problems/make-two-arrays-equal-by-reversing-sub-arrays/ Make Two Arrays Equal by Reversing Sub-arrays - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 두 배열을 구성하는 숫자가 다르면 무조건 false 숫자 개수가 다르거나, 없는 숫자가 있거나.. class Solution { public: bool canBeEqual(vector& targe.. 2020. 7. 21.