Some interesting tasks I found and solved them using Python 3. This project is under development, when I find something interesting I keep adding it to this repository.
- Technologies
- Automate_the_boring_stuff
- Battleship_field_validator
- Caesar 2
- Chain_lightning_challenge
- Crack_the_pin
- Determine_if_number
- Exercism
- Int32_to_IPv4
- Irreducible_sum_of_rationals
- Linked_lists
- Password_cracker
- Play_with_arrays
- Tasks_about_graphs
- Tasks_about_strings
- Weird_prime_generator
- Newest_solutions
- Python 3.9
- Library Hashlib
- Library Itertools
- Library Math
- Library Re
- Library String
My solutions to projects described in 'Automate the boring stuff with Python' by Albert Sweigart. Each individual .py file solves problem given at the end of its title's chapter (e.g. chapter_3.py solves problem described at the end of chapter 3, etc.).
My solution to task found on https://www.codewars.com/kata/52bb6539a4cf1b12d90005b7.
Second variation on Ceasar cipher, task from codewars.com (https://www.codewars.com/kata/55084d3898b323f0aa000546).
My solution to challenge: https://challengerocket.com/chain-lightning-challenge/. Further description is in description.txt in the folder Chain_lightning_challenge.
Solution to following problem found on Codewars: https://www.codewars.com/kata/5efae11e2d12df00331f91a6
Solution to following problem found in Daily Interview Pro newsletter (https://www.techseries.dev/daily):
Given a string that may represent a number, determine if it is a number. Here's some of examples of how the number may be presented:
'"123" # Integer'
'"12.3" # Floating point'
'"-123" # Negative numbers'
'"-.3" # Negative floating point'
'"1.5e5" # Scientific notation'
Here's some examples of what isn't a proper number:
'"12a" # No letters'
'"1 2" # No space between numbers'
'"1e1.2" # Exponent can only be an integer (positive or negative or 0)'
Scientific notation requires the first number to be less than 10, however to simplify the solution assume the first number can be greater than 10. Do not parse the string with int() or any other python functions.
My solutions to problems I found more interesting during my path on exercism.
Solution to following problem found on Codewars: https://www.codewars.com/kata/52e88b39ffb6ac53a400022e
Solution to following problem found on Codewars: https://www.codewars.com/kata/5517fcb0236c8826940003c9
- add_two_numbers: my solutions to problem found on leetcode.com: https://leetcode.com/problems/add-two-numbers/
- remove_elements: my solution to problem found on: https://leetcode.com/problems/remove-linked-list-elements/
Solution to following problem found on Codewars: https://www.codewars.com/kata/59146f7b4670ba520900000a
Solution to problems regarding arrays.
- Circles - my solution to following problem: You are given n numbers on a circle, described by an array A. Find the maximum number of neighbouring pairs whose sums are even. One element can belong to only one pair.
- median_of_two_sorted_arrays - my solution to problem found on: https://leetcode.com/problems/median-of-two-sorted-arrays/
- Minimum_moves - my solution to problem found on: https://leetcode.com/problems/minimum-moves-to-equal-array-elements-ii
- smoke_signals - my solution to problem found on: https://www.codewars.com/kata/62a3855fcaec090025ed2a9a
- Spiralize - my solution to problem found on: https://www.codewars.com/kata/534e01fbbb17187c7e0000c6/
- TheMillionthFibonacci - my solution to problem found on: https://www.codewars.com/kata/53d40c1e2f13e331fc000c26
- TheBee - my solution to problem: https://www.codewars.com/kata/6408ba54babb196a61d66a65
- two_sum - my solution to problem found on: https://leetcode.com/problems/two-sum/
Solutions to problems with graphs.
- max_sum - Given an undirected graph consisting of N vertices, numbered from 1 to N, and M edges. The graph is described by two arrays, A and B, both of length M. A pair (A[K], B[K]), for K from 0 to M-1, describes an edge between vertex A[K] and vertex B[K]. Task is to assign all values from the range [1, N] to the vertices of the graph in such a way that one number is given to one vertice and sum over all edges of the values at the edges' endpoints is maximal.
- root_to_leaf_sum - Solution to following problem found on LeetCode: https://leetcode.com/problems/sum-root-to-leaf-numbers/
Solutions to problems with strings.
- break_a_palindrome - Given a palindromic string of lowercase English letters palindrome, replace exactly one character with any lowercase English letter so that the resulting string is not a palindrome and that it is the lexicographically smallest one possible
- burrows_wheeler_transformation - Solution to following problem found on Codewars: https://www.codewars.com/kata/54ce4c6804fcc440a1000ecb
- decode_int - my solution to task: https://www.codewars.com/kata/566859a83557837d9700001a
- excel_sheet - my solution to task: https://www.codewars.com/kata/55ee3ebff71e82a30000006a
- find_first_unique_letter - find the most efficient way to find the first unique letter in given string
- morse_code - my solutions to tasks https://www.codewars.com/kata/54b72c16cd7f5154e9000457 and https://www.codewars.com/kata/54acd76f7207c6a2880012bb
- moves_in_squared_strings - my solution to following problem found on Codewars: https://www.codewars.com/kata/56dbe7f113c2f63570000b86
- nico - my solution to problem found on Codewars: https://www.codewars.com/kata/5968bb83c307f0bb86000015
- Play_with_two_strings - Solution to following problem found on Codewars: https://www.codewars.com/kata/56c30ad8585d9ab99b000c54
- Rainfall - Solution to following problem found on Codewars: https://www.codewars.com/kata/56a32dd6e4f4748cc3000006
- rle - Solution to following problem found on Codewars: https://www.codewars.com/kata/546dba39fa8da224e8000467
- string_mix - Solution to following problem found on Codewars: https://www.codewars.com/kata/5629db57620258aa9d000014
Solution to following problem found on Codewars: https://www.codewars.com/kata/562b384167350ac93b00010c
march 2023:
- decode_int (done)
- excel_sheet (done)
- morse_code (in progress)
- TheBee (in progress)