This file contains 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
class javachallenge { | |
public static int[] rotate(int[] arr) { | |
int k = 2; | |
int[] nums = arr; | |
int length = nums.length; | |
int left = length - (k % length); | |
int right = k % length; | |
int[] newArr = new int[length]; |
This file contains 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
class javachallenge { | |
public static boolean check(char[] password) { | |
// Enter your code here | |
boolean haveDigits = false; | |
boolean haveLetter = false; | |
if (password.length >= 8) { | |
for (int i = 0; i < password.length; i ++) { | |
if (Character.isDigit(password[i])) { |
This file contains 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 java.util.ArrayList; | |
import java.util.List; | |
class javachallenge { | |
public static boolean ugly(int number) { | |
if (number == 1) return true; | |
int n = number; | |
List<Integer> factors = new ArrayList<Integer>(); | |
for (int i = 2; i <= n; i++) { | |
while (n % i == 0) { |
This file contains 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 'package:flutter/material.dart'; | |
class CustomSwitch extends StatefulWidget { | |
const CustomSwitch( | |
{Key? key, required this.leftStr, required this.rightStr, this.onChange}) | |
: super(key: key); | |
final String leftStr; | |
final String rightStr; | |
final Function(int selected)? onChange; |
This file contains 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
#!/usr/bin/python3 | |
import re | |
import datetime | |
import os | |
#download hosts file path. | |
hostsFile="hosts" | |
#zone file save path. | |
outputZoneFile="hosts.zone" | |
#target named zone file path | |
targetZoneFile="/usr/local/named/var/rpz.zone" |