server:
port: 9091
eureka:
client:
register-with-eureka: false
fetch-registry: false
This file contains 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
spring: | |
datasource: | |
url: jdbc:h2:mem:testdb | |
h2: | |
console: | |
enabled: true |
This file contains 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
package edu.miu.annapurnabe; | |
import edu.miu.annapurnabe.dto.response.MealResponseDetailDTO; | |
import java.time.LocalDate; | |
import java.time.format.DateTimeFormatter; | |
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.function.Function; |
This file contains 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
/** | |
* * An array is defined to be odd-heavy if it contains at least one odd element and every odd | |
* * element is greater than every even element. So {11, 4, 9, 2, 8} is odd-heavy because the two odd elements (11 and 9) | |
* * are greater than all the even elements. | |
* * | |
* * And {11, 4, 9, 2, 3, 10} is not odd-heavy because the even element | |
* * 10 is greater than the odd element 9. Write a function called isOddHeavy that accepts an integer array and | |
* * returns 1 if the array is odd-heavy; otherwise it returns 0. | |
* * | |
* * Some other examples: {1} is odd-heavy, {2} is not |
This file contains 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
/** | |
* | |
* Print numbered Flag | |
* 1 | |
* 2 3 | |
* 4 5 6 | |
* 7 8 9 10 | |
* 11 12 13 14 15 | |
* | |
*/ |
This file contains 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
/** | |
* * Print a numbered flag | |
* * 1 | |
* * 12 | |
* * 123 | |
* * 1234 | |
* * 12345 | |
*/ | |
package com.basic.practice; |
This file contains 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
/** | |
* * Write a function sumIsPower with signature boolean sumIsPower(int[] arr) | |
* * which outputs true if the sum of the elements in the input array arr is a power of 2, false otherwise. | |
* * | |
* * Recall that the powers of 2 are 1, 2, 4, 8, 16, and so on. | |
* * In general a number is a power of 2 if and only if it is of the form 2^n for some non-negative integer n. | |
* * | |
* * You may assume (without verifying in your code) that all elements in the array | |
* * are positive integers. | |
* * |
This file contains 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
/** | |
* | |
* Print Nepal Flag in your console. | |
*/ | |
package com.basic.practice; | |
public class NepalFlag { | |
public static void main(String[] args) { | |
printFlag(); |
This file contains 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
/** | |
* * Write a function named countDigit that returns the number of times that a given digit appears in a | |
* * positive number. | |
* * | |
* * For example countDigit(32121, 1) would return 2 because there are two 1s in 32121.Other examples: | |
* * countDigit(33331, 3) returns 4 | |
* * countDigit(33331, 6) returns 0 | |
* * countDigit(3, 3) returns 1 | |
* * | |
* * The function should return -1 if either argument is negative, so |
This file contains 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
/** | |
* * Write a function named minDistance that returns the smallest distance between two factors of a number. | |
* * | |
* * For example, consider 13013 = 1*7*11*13. Its factors are 1, 7, 11, 13 and 13013. | |
* * minDistance(13013) would return 2 because the smallest distance between any two factors is 2 (13 - 11 = 2). | |
* * | |
* * As another example, minDistance (8) would return 1 because the factors of 8 are 1, 2, 4, 8 | |
* * and the smallest distance between any two factors is 1 (2 – 1 = 1). | |
* * | |
* * The function signature is |
NewerOlder