Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HelloWorld.bat #579

Open
wants to merge 9 commits into
base: mergify/vichitr/config-update
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions HelloWorld/HelloWorld.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off
echo Hello, World!
pause
8 changes: 8 additions & 0 deletions HelloWorld/שלום_עולם.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
hello_input = input("Enter 'hello': ")


world_input = input("Enter 'world': ")

print(hello_input + " " + world_input)


24 changes: 24 additions & 0 deletions HelloWorld/שלוםעולם
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package main.cotributions;

import java.util.Scanner;

public class Main {
public static void main(String[] args) {

Scanner scanner = new Scanner(System.in);

System.out.println("Write ----> Hello ");
String hello = scanner.next();
System.out.println("Write ----> World");
String world = scanner.next();

System.out.println(hello+" "+world);




scanner.close();


}
}
35 changes: 35 additions & 0 deletions LeetCode/twoSum.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import java.util.HashMap;

class Solution {
public int[] twoSum(int[] nums, int target) {
HashMap<Integer, Integer> numMap = new HashMap<>();
for (int i = 0; i < nums.length; i++) {
int complement = target - nums[i];
if (numMap.containsKey(complement)) {
return new int[]{numMap.get(complement), i};
}
numMap.put(nums[i], i);
}
return null;
}
}

public class Main {
public static void main(String[] args) {
int[] nums = {2, 7, 11, 15};
int target = 9;

Solution solution = new Solution();
int[] result = solution.twoSum(nums, target);
for (int num : result) {
System.out.print(num + " ");
}
}
}
When you run this code, it will output 0 1, indicating that the elements at indices 0 and 1 (2 and 7) in the nums array add up to the target number 9.