Skip to content

Instantly share code, notes, and snippets.

View clarkdo's full-sized avatar

Xin Du (Clark) clarkdo

  • Dublin, Ireland
View GitHub Profile
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;
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);
}
}
<template>
<section>
<Btn/>
</section>
</template>
<script>
export default {
components: {
Btn: Button