What do you want to save?
Add Code snippet
New code examples
-
Java 2021-09-15 12:44:03
smallest positive integer not in array java
If the expected running time should be linear, you can't use a TreeSet, which sorts the input and therefore requires O(NlogN). Therefore you should use a HashSet, which requires O(N) time to add N elements. Besides, you don't need 4 loops. It's sufficien... Add solution -
Other 2021-09-14 02:35:02
toggle led arduino
// We name pin D0 as led int led = D0; // This routine runs only once upon reset void setup() { // Initialize D0 pin as an output pinMode(led, OUTPUT); } // This routine loops forever void loop() { digitalWrite(led, !digitalRead(led)); // To... Add solution -
C 2021-09-13 11:51:03
multiplication table in c
#include <stdio.h> int main(){ //declaring variables int n,i,a,start,end; //taking and printing the instructions printf("Enter first number from where you want to start multiplication : \n"); scanf("%d",&sta... Add solution -
Kotlin 2021-09-07 16:39:02
for loop in kotlin with index
val array = arrayOf(1, 3, 9) for (item in array) { //loops items } for (index in 0..array.size - 1) { //loops all indices } for (index in 0 untill array.size) { //loops all indices } for (index in array.indices) { //loops all indices (perform... Add solution -
Java 2021-09-05 00:37:02
java take out cn from dn
String dn = "CN=Jimmy Blooptoop,OU=Someplace,OU=Employees,DC=Bloopsoft-Inc"; LdapName ln = new LdapName(dn); for(Rdn rdn : ln.getRdns()) { if(rdn.getType().equalsIgnoreCase("CN")) { System.err.println("CN is: " +... Add solution -
VBA 2021-09-02 22:52:01
excel vba exit for next loop
'In VBA how to exit a For Next loop when a condition 'is met: use Exit For. For i = 1 To 1000 c = c + 1 If c = 750 Then Exit For Next 'Exit For can also be used inside a For Each loop: For Each r In [A1:A10] c = c + c If r.Value = "Hi&qu... Add solution -
Javascript 2021-09-01 00:54:02
javascript loop aray
const myArray = [6, 19, 20];const yourArray = [19, 81, 2];for (let i = 0; i < myArray.length; i++) { for (let j = 0; j < yourArray.length; j++) { if (myArray[i] === yourArray[j]) { &nb... Add solution
Best helpers
Michaelyus
+5
EBA2018
+5
Eric Lewis
+5
J. Tatum
+5
Erwaman
+5
Jp_
+5
Fauve
+5
Katy Forde
+5
Jcvamp
+5
Chris
+5
Xiaotian Pei
+5