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
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.0; | |
contract MyToken { | |
string public name; | |
string public symbol; | |
uint8 public decimals; | |
uint256 public totalSupply; | |
mapping(address => uint256) public balanceOf; | |
mapping(address => mapping(address => uint256)) public allowance; |
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
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.0; | |
contract HealthRecordRepository { | |
enum AdmissionStatus { Admitted, NotAdmitted } | |
struct HealthRecord { | |
uint256 recordID; | |
string patientName; | |
uint256 age; |
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
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.0; | |
contract HealthRecordRepository { | |
struct HealthRecord { | |
uint256 recordID; | |
string patientName; | |
uint256 age; | |
string diagnosis; | |
string treatment; |
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
/* | |
* Complete the 'miniMaxSum' function below. | |
* | |
* The function accepts INTEGER_ARRAY arr as parameter. | |
*/ | |
function miniMaxSum(arr) { | |
// Write your code here | |
arr.sort(); |
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
/* | |
* Complete the 'sockMerchant' function below. | |
* | |
* The function is expected to return an INTEGER. | |
* The function accepts following parameters: | |
* 1. INTEGER n | |
* 2. INTEGER_ARRAY ar | |
*/ | |
function sockMerchant(n, ar) { |
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
function plusMinus(arr) { | |
// Write your code here | |
let plusCount = 0; | |
let minusCount = 0; | |
let zeroCount = 0; | |
const n = arr.length; | |
for (const i of arr) { | |
if(i < 0) minusCount++; | |
if(i > 0) plusCount++; |
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
/* | |
* Complete the 'minimumNumber' function below. | |
* | |
* The function is expected to return an INTEGER. | |
* The function accepts following parameters: | |
* 1. INTEGER n | |
* 2. STRING password | |
*/ | |
function minimumNumber(n, password) { |
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
function camelcase(s) { | |
// Write your code here | |
let wordCount = 1; | |
let i = 0; | |
while (i < s.length) { | |
if(s[i].toUpperCase() === s[i]) wordCount++; | |
i++; | |
} | |
return wordCount; | |
} |
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
/* | |
* Complete the 'climbingLeaderboard' function below. | |
* | |
* The function is expected to return an INTEGER_ARRAY. | |
* The function accepts following parameters: | |
* 1. INTEGER_ARRAY ranked | |
* 2. INTEGER_ARRAY player | |
*/ | |
function climbingLeaderboard(ranked, player) { |
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
/* | |
* Complete the 'bonAppetit' function below. | |
* | |
* The function accepts following parameters: | |
* 1. INTEGER_ARRAY bill | |
* 2. INTEGER k | |
* 3. INTEGER b | |
*/ | |
function bonAppetit(bill, k, b) { |
NewerOlder