Skip to content
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
Binary file added MissingNumberSum.class
Binary file not shown.
15 changes: 15 additions & 0 deletions MissingNumberSum.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// File: MissingNumberSum.java
public class MissingNumberSum {
public static int missingNumber(int[] nums) {
int n = nums.length;
long expected = (long) n * (n + 1) / 2; // use long to avoid overflow
long actual = 0;
for (int v : nums) actual += v;
return (int) (expected - actual);
}

public static void main(String[] args) {
int[] a1 = {3,0,1};
System.out.println(missingNumber(a1)); // 2
}
}
20 changes: 20 additions & 0 deletions Palindrome.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import java.util.*;

class PalindromeString {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print("Enter a string: ");
String s = sc.nextLine();

String rev = "";
for (int i = s.length() - 1; i >= 0; i--) {
rev = rev + s.charAt(i);
}

if (s.equals(rev)) {
System.out.println("Palindrome");
} else {
System.out.println("Not Palindrome");
}
}
}
2 changes: 2 additions & 0 deletions aman.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
a=10
print(a)
48 changes: 48 additions & 0 deletions ankit.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="styled.css">
</head>
<body>
<h1>hello deepak</h1>
<h1>I am good, how are you</h1>
<div>
<p>Prithibi ta naki choto hote hote Lyrics
[Verse 1]
Prithibita naki choto hote hote
Satellite aar cable er hate
Drawing room a rakha boka baksho te bondhi

[Verse 2]
Ghore boshe sara duniyar saathe
Jogajog aaj hater mutho te
Ghuche geche desh kal simanar gondi

[Chorus]
Bhebe dekhecho ki
Tara rao joto alok borsho dure
Taro dure
Tumi aar ami jai krome shore shore
Bhebe dekhecho ki
Tara rao joto alok borsho dure
Taro dure
Tumi aar ami jai krome shore shore

[Verse 3]
Shaari shaari mukh aashe aar jae
Neshatur chokh tv porday
Poka-makore aguner sathe songii

[Verse 4]
Pasha pashi boshe еk sathe dekha
Ek sathe noy asholе je eka
Tomar amar bharater noya fondi</p>

</div>
<p style="color:black">This masterpeice was created in the early 1970s. it is then adapted in bollywood Without giving any credit to its original makers ( Crosswinds, Lakkhichara, and Moheener Ghoraguli) Bengali music was ahead of its time.</p>
<audio src="./audio/Prithibita-Naki-Choto-Hote-Hote.mp3" controls muted></audio>
</body>
</html>
Binary file added audio/Prithibita-Naki-Choto-Hote-Hote.mp3
Binary file not shown.
25 changes: 25 additions & 0 deletions buyand sell.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#include <iostream>
#include <vector>
using namespace std;

class Solution {
public:
int maxProfit(vector<int>& prices) {
int profit = 0;
for (int i = 1; i < prices.size(); i++) {
if (prices[i] > prices[i - 1]) {
profit += prices[i] - prices[i - 1];
}
}
return profit;
}
};

int main() {
Solution obj;
vector<int> prices = {7, 1, 5, 3, 6, 4};
int result = obj.maxProfit(prices);
cout << "Maximum Profit: " << result << endl;
return 0;
}

24 changes: 24 additions & 0 deletions ccdc.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#include<iostream>
using namespace std;
void print(int n){
for(int i=0;i<n;i++){
for(int j=0;j<=n-i+1;j++){
cout<<j;
}
cout<<endl;
}
}

int main(){

int t;
cin>>t;

for(int i=0;i<t;i++){
int n;
cin>>n;
print(n);
cout<<" ";
}

}
21 changes: 21 additions & 0 deletions change.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<button onclick="mycolor()"> hello </button>
<script>function mycolor(){
let r=Math.floor(Math.random()*256)
let g=Math.floor(Math.random()*256)
let b=Math.floor(Math.random()*256)
let my= `rgb(${r},${g},${b})`
document.body.style.backgroundColor=my;
}


</script>
</body>
</html>
48 changes: 48 additions & 0 deletions code.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#include <iostream>
#include <string>
using namespace std;

class Solution {
public:
string longestPalindrome(string s) {
int start = 0, maxLen = 1; // start index and max length

for (int i = 0; i < s.length(); i++) {
// Odd length palindrome
int l = i, r = i;
while (l >= 0 && r < s.length() && s[l] == s[r]) {
if (r - l + 1 > maxLen) {
start = l;
maxLen = r - l + 1;
}
l--;
r++;
}

// Even length palindrome
l = i, r = i + 1;
while (l >= 0 && r < s.length() && s[l] == s[r]) {
if (r - l + 1 > maxLen) {
start = l;
maxLen = r - l + 1;
}
l--;
r++;
}
}

return s.substr(start, maxLen);
}
};

int main() {
Solution sol;
string str;
cout << "Enter a string: ";
cin >> str;

string ans = sol.longestPalindrome(str);
cout << "Longest Palindromic Substring: " << ans << endl;

return 0;
}
3 changes: 3 additions & 0 deletions first.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
print (13&19)
print (13 | 19)
print(13 ^ 19)
58 changes: 58 additions & 0 deletions grid.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Grid Exercise with Rows + Media Query</title>
<style>
*{box-sizing:border-box;margin:0;padding:0}
body{font-family:Arial,Helvetica,sans-serif;background:#f5f5f5;padding:20px}

h2{text-align:center;margin-bottom:15px}

.gallery{
display:grid;
grid-template-columns: repeat(3, 1fr);
gap:12px;
max-width:1000px;
margin:0 auto;
}
.gallery img{
width:100%;
height:100%;
object-fit:cover;
border-radius:8px;
box-shadow:0 2px 6px rgba(0,0,0,0.2);
}


@media(max-width:900px){
.gallery{
grid-template-columns:repeat(2,1fr);
grid-template-rows:auto auto auto;
}
}


@media(max-width:500px){
.gallery{
grid-template-columns:1fr;
grid-template-rows:auto;
}
}
</style>
</head>
<body>

<h2>Responsive Image Gallery (Rows + Columns)</h2>
<div class="gallery">
<img class="img1" src="https://picsum.photos/id/1011/600/400" alt="img1">
<img src="https://picsum.photos/id/1021/600/400" alt="img2">
<img src="https://picsum.photos/id/1031/600/400" alt="img3">
<img src="https://picsum.photos/id/1041/600/400" alt="img4">
<img src="https://picsum.photos/id/1051/600/400" alt="img5">
<img src="https://picsum.photos/id/1061/600/400" alt="img6">
</div>

</body>
</html>
62 changes: 62 additions & 0 deletions grid2.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@

Viewed
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Grid Exercise with Rows + Media Query</title>
<style>
*{box-sizing:border-box;margin:0;padding:0}
body{font-family:Arial,Helvetica,sans-serif;background:#f5f5f5;padding:20px}

h2{text-align:center;margin-bottom:15px}

.gallery{
display:grid;
grid-template-columns: repeat(3, 1fr);
gap:12px;
max-width:1000px;
margin:0 auto;
}
.gallery img{
width:100%;
height:100%;
object-fit:cover;
border-radius:8px;
box-shadow:0 2px 6px rgba(0,0,0,0.2);
}


@media(max-width:900px){
.gallery{
grid-template-columns:repeat(2,1fr);
grid-template-rows:auto auto auto;
}
}


@media(max-width:500px){
.gallery{
grid-template-columns:1fr;
grid-template-rows:auto;
}
}
</style>
</head>
<body>

<h2>Responsive Image Gallery (Rows + Columns)</h2>
<div class="gallery">
<img class="img1" src="https://picsum.photos/id/1011/600/400" alt="img1">
<img src="https://picsum.photos/id/1021/600/400" alt="img2">
<img src="https://picsum.photos/id/1031/600/400" alt="img3">
<img src="https://picsum.photos/id/1041/600/400" alt="img4">
<img src="https://picsum.photos/id/1051/600/400" alt="img5">
<img src="https://picsum.photos/id/1061/600/400" alt="img6">
</div>

</body>
</html>
14 changes: 14 additions & 0 deletions index .html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>

<body>
<h1>Hello sharvan</h1>
</body>

</html>
Empty file added index.html11
Empty file.
16 changes: 16 additions & 0 deletions index1.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>

<h1>this is bhopal</h1>
<h2>this is mp nagar</h2>
<h3>cybrom technology</h3>


</body>
</html>
1 change: 1 addition & 0 deletions k.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
git
Loading