This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Solution { | |
public int solution(int[] A) { | |
int len = A.length; | |
if (len == 0) return 0; | |
int min = A[0]; | |
int profits = 0; | |
for (int i = 1; i < len; i++) { | |
int price = A[i]; | |
if (price < min) { | |
min = price; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Solution { | |
public int solution(int N) { | |
int A = (int)Math.round(Math.sqrt(N)); | |
while (N % A != 0) A--; | |
return 2*(A + N/A); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<section> | |
<Btn/> | |
</section> | |
</template> | |
<script> | |
export default { | |
components: { | |
Btn: Button |
OlderNewer