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
int findMissing(int arr[], int n) { | |
for(int i = 0; i < n; i++){ | |
//looking for all the conditions | |
while(arr[i] >= 1 && arr[i] <= n && arr[i] != arr[arr[i]-1]) | |
swap(arr[i], arr[arr[i]-1]); | |
} | |
//to check our missing number. For explaination, refer the article. | |
for(int i = 0; i < n; i++){ | |
if(arr[i] != i + 1) | |
return i + 1; |
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
import "./App.css"; | |
function App() { | |
return ( | |
<div className="App"> | |
</div> | |
); | |
} |
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
import "./App.css"; | |
function App() { | |
return ( | |
<div className="App"> | |
<h1 className="heading">Cash Register Manager</h1> | |
<div className="cash-register"> | |
<div className="form"> | |
</div> |
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
<div className="form"> | |
<label>Bill</label> | |
<input type="number" placeholder="0"></input> | |
<br /> | |
<label>Cash Given</label> | |
<input type="number" placeholder="0"></input> | |
<br /> | |
<button>Return Change</button> | |
</div> |
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
.App { | |
display: flex; | |
flex-direction: column; | |
align-items: center; | |
font-family: monospace; | |
} | |
.heading { | |
padding-top: 20vh; | |
font-size: xx-large; | |
} |