Python

Keep only certain columns in a dataframe
AskAI

This technical problem deals with how to keep only certain columns in a dataframe using Python. A function is provided that takes in a dataframe and a list of column names, and returns a new dataframe with only the columns in the list. An example is given of input and output.

Tower of Hanoi Algorithm
AskAI

The goal of the Tower of Hanoi algorithm is to move a stack of disks from one peg to another, without ever placing a larger disk on top of a smaller disk. The input will consist of the starting peg, the goal peg, and the number of disks. The output should consist of a series of instructions on how to move the disks from the starting peg to the goal peg .

Tower of Hanoi
AskAI

The Tower of Hanoi problem is a classic algorithmic puzzle that can be solved using a simple recursive algorithm. Given a stack of n disks, the algorithm moves the disks from the first stack to the last stack, using only three stacks and moving only one disk at a time. The disks must be moved so that the smallest disk is on top of the largest disk.

Adjacent Integer Sums in Python
AskAI

This problem asks the programmer to write a function that returns the largest sum that can be generated by adding together any two adjacent integers in a given list. An example input and output is given.

Get the title of a given URL.
AskAI

This technical problem deals with scraping the title from a given URL. An example input and output is provided.

Is This a Magic Square?
AskAI

The function checks if the given 3x3 grid of numbers is a magic square or not. A magic square is a 3x3 grid of numbers where each row, column, and diagonal sum to the same number.

Checking if a Square Matrix is a Magic Square
AskAI

This technical problem deals with writing a function that takes in an n x n matrix representing a magic square and returns True if the square is magic, and False otherwise. A magic square is a square matrix in which the sum of the elements in each row, column, and diagonal is the same.

Is this a valid magic square?
AskAI

The problem is to check whether a given 2D array of integers is a valid magic square. A magic square is a square array of integers where the sum of each row, column, and diagonal is the same.