PHP script that generates a business name

<?php // Set up the list of adjectives and nouns $adjectives = [‘Creative’, ‘Elegant’, ‘Modern’, ‘Stylish’, ‘Unique’]; $nouns = [‘Design’, ‘Solutions’, ‘Tech’, ‘Works’]; // Generate a random index for each list $adjectiveIndex = array_rand($adjectives); $nounIndex = array_rand($nouns); // Combine the randomly selected adjective and noun to create the business name $businessName = $adjectives[$adjectiveIndex] . ‘ … Read more

PHP code that generates qr code

Here is a simple PHP script that generates a QR code: Copy code<?php // Required library require_once ‘vendor/autoload.php’; // Use the library namespace use Endroid\QrCode\QrCode; // Create a new QR code $qrCode = new QrCode(‘https://www.example.com’); // Set additional options $qrCode->setSize(300); // Directly output the QR code header(‘Content-Type: ‘.$qrCode->getContentType()); echo $qrCode->writeString(); This script uses the endroid/qr-code … Read more

Minecraft skin Generator script in php, HTML, CSS

To create a Minecraft skin generator tool for your WordPress website, you will need to use a combination of PHP, HTML, and CSS to create the user interface and a script to generate the skins. Here are the steps you can follow: It’s worth noting that creating a Minecraft skin generator tool can be a … Read more

Truck Delivery Solution Google Kickstart 2021

Truck Delivery Solution Google Kickstart 2021 Problem Charles is a truck driver in the city of Googleland. Googleland is built in form of a tree with NN nodes where each node represents a city and each edge represents a road between two cities. The cities are numbered 11 to NN. The capital of Googleland is city 11. Each day Charles picks … Read more

Longest Progression Solution Google Kickstart 2021

Longest Progression Solution Google Kickstart 2021 Problem Sarasvati learned about arithmetic arrays. An arithmetic array is an array that contains at least two integers and the differences between consecutive integers are equal. For example, [9,10][9,10], [3,3,3][3,3,3], and [9,7,5,3][9,7,5,3] are arithmetic arrays, while [1,3,3,7][1,3,3,7], [2,1,2][2,1,2], and [1,2,4][1,2,4] are not. Sarasvati again has an array of NN non-negative integers. The ii-th integer of the array is AiAi. She can … Read more

Increasing Substring Solution Google Kickstart 2021

Increasing Substring Solution Google Kickstart 2021 Problem Your friend John just came back from vacation, and he would like to share with you a new property that he learned about strings. John learned that a string CC of length LL consisting of uppercase English characters is strictly increasing if, for every pair of indices ii and jj such that 1≤i<j≤L1≤i<j≤L (11-based), the character at position ii is … Read more

Binary Operator Solution Google Kickstart 2021

Binary Operator Solution Google Kickstart 2021 Problem You are given a list of valid arithmetic expressions using non-negative integers, parentheses (), plus +, multiply *, and an extra operator #. The expressions are fully parenthesized and in infix notation. A fully parenthesized expression is an expression where every operator and its operands are wrapped in a single parenthesis.For example, the expression x+yx+y becomes (x+y)(x+y) when … Read more

Rock Paper Scissors Solution Google Kickstart 2021

Rock Paper Scissors Solution Google Kickstart 2021 Problem You and your friend like to play Rock Paper Scissors. Each day you play exactly 6060 rounds and at the end of each day, you tally up the score from these 6060 rounds. During each round, without any knowledge of the other person’s choice, you each make your choice. Then, you both … Read more

Alien Generator Solution Google Kickstart 2021

Alien Generator Solution Google Kickstart 2021 Problem Astronauts have landed on a new planet, Kickstartos. They have discovered a machine on the planet: a generator that creates gold bars. The generator works as follows. On the first day, an astronaut inputs a positive integer KK into the generator. The generator will produce KK gold bars that day. The next … Read more

Smaller Strings Solution Google Kickstart 2021

Smaller Strings Solution Google Kickstart 2021 Problem You are given an integer KK and a string SS of length NN, consisting of lowercase letters from the first KK letters of the English alphabet. Find the number of palindrome strings of length NN which are lexicographically smaller than SS and consist of lowercase letters from the first KK letters of the English alphabet. A string composed of ordered letters a1,a2,…,ana1,a2,…,an is … Read more

Double or NOTing Solution Code Jam 2021

Double or NOTing Solution Code Jam 2021 Problem You are given a starting non-negative integer SS and an ending non-negative integer EE. Both SS and EE are given by their binary representation (that is, they are given written in base 22). Your goal is to transform SS into EE. The following two operations are available to you: Double your current value. Take the bitwise NOT of … Read more

Roaring Years Solution Code Jam 2021

Problem Something is happening in 20212021 that has not happened in over a century. 20212021, like 19201920 before it, is a roaring year. A year represented by a positive integer yy is roaring if the decimal writing (without leading zeroes) of yy is the concatenation of the decimal writing (without leading zeroes) of two or more distinct consecutive positive integers, in increasing order. In … Read more

Closest Pick Solution Code Jam 2021

Problem You are entering a raffle for a lifetime supply of pancakes. NN tickets have already been sold. Each ticket contains a single integer between 11 and KK, inclusive. Different tickets are allowed to contain the same integer. You know exactly which numbers are on all of the tickets already sold and would like to maximize your odds of winning … Read more

[Solution] GCD Sum Codeforces Round #711

The gcdSumgcdSum of a positive integer is the gcdgcd of that integer with its sum of digits. Formally, gcdSum(x)=gcd(x, sum of digits of x)gcdSum(x)=gcd(x, sum of digits of x) for a positive integer xx. gcd(a,b)gcd(a,b) denotes the greatest common divisor of aa and bb — the largest integer dd such that both integers aa and bb are divisible by dd. For example: gcdSum(762)=gcd(762,7+6+2)=gcd(762,15)=3gcdSum(762)=gcd(762,7+6+2)=gcd(762,15)=3. Given an integer nn, find the smallest integer x≥nx≥n such that gcdSum(x)>1gcdSum(x)>1.Input The first line of input contains one integer tt (1≤t≤104)(1≤t≤104) — the … Read more