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
| module.exports = { | |
| parser: '@typescript-eslint/parser', | |
| parserOptions: { | |
| ecmaVersion: 2020, | |
| sourceType: 'module', | |
| ecmaFeatures: { | |
| jsx: true, | |
| }, | |
| }, | |
| settings: { |
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
| const binarySearch = (sortedArray, item) => { | |
| let start = 0; | |
| let end = sortedArray.length - 1; | |
| let middle = Math.floor((start + end) / 2); | |
| while (start <= end) { | |
| if (sortedArray[middle] === item) return true; | |
| else if (item > sortedArray[middle]) | |
| start = middle + 1; | |
| else |
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
| let visited = []; | |
| for (let i = 1; i <= 8; i++) visited[i] = 0; | |
| const graph = [[], [2, 3, 4], [5, 6], [7, 8], [8]]; | |
| const bfs = (source, graph) => { | |
| let queue = []; | |
| queue.push(source); | |
| visited[source] = 1; | |
| while(queue.length > 0) { |
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
| // All material is licensed under the Apache License Version 2.0, January 2004 | |
| // http://www.apache.org/licenses/LICENSE-2.0 | |
| // Write a program that creates a fixed set of workers to generate random | |
| // numbers. Discard any number divisible by 2. Continue receiving until 100 | |
| // numbers are received. Tell the workers to shut down before terminating. | |
| package main | |
| import ( | |
| "fmt" |
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
| { | |
| "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", | |
| "contentVersion": "1.0.0.0", | |
| "parameters": { | |
| "environment": { | |
| "value": "dev" | |
| }, | |
| "keyValueNames": { | |
| "value": [ | |
| "myKeyDev$labelProd", |
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
| { | |
| "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", | |
| "contentVersion": "1.0.0.0", | |
| "parameters": { | |
| "configStoreName": { | |
| "type": "string", | |
| "metadata": { | |
| "description": "Specifies the name of the App Configuration store." | |
| } | |
| }, |
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
| vector<int> twoSum(vector<int>& nums, int target) { | |
| unordered_map<int, int> mp; | |
| vector<int>answer; | |
| for (int i=0;i<nums.size();i++) | |
| mp[nums[i]] = i; | |
| int y = 0; | |
| for (int i=0;i<nums.size();i++) { | |
| y = target - nums[i]; |
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
| //Knapsack Problem el problema de la mochila! | |
| #include<stdio.h> | |
| #include<algorithm> | |
| #include <string.h> | |
| using namespace std; | |
| int G, MW, N, T, sum_values; | |
| int dp(int,int); | |
| struct Bag { | |
| int price, weight; |
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
| values = [60, 10, 12] | |
| weights = [10, 20, 30] | |
| totalWeight = 50 | |
| n = len(values) | |
| memo = [[-1 for i in range(100)] for j in range(100)] | |
| def knapSack(totalWeight, i): | |
| if memo[totalWeight][i] != -1: | |
| return memo[totalWeight][i] |
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
| values = [60, 10, 12] | |
| weights = [40, 20, 30] | |
| totalWeight = 50 | |
| n = len(values) | |
| def knapSack(totalWeight, i): | |
| if i == n or totalWeight <= 0: | |
| return 0 |
NewerOlder