instruction
stringlengths
71
95.1k
Ok, so here's the code: Please, comment if there are mistakes #include <stdio.h> #include <windows.h> main() { int h, m, s; int d = 1000; printf("Set the Clock time: \n"); scanf("%d%d%d", &h,&m,&s); if (h > 24 || m > 60 || s > 60) { printf("ERROR!"); exit(0); } while(1) ...
I built 2048 in Python with Pygame and it works as expected. I wanted to know where I could - Optimize the performance. Improve the UX. Or just improve the code readability. My file directory - 2048 - | - constants.py | - app.py | - main.py Run using python main.py or python3 main.py. Here is the ...
I need help making my Python code easier to read. My friend and I are creating a stock market simulator. This is the function for the buying mechanic. The purpose of this section is to simulate a buying process. If the user wants to buy a specific stock, they just type its name into the terminal. It then asks them the ...
1. Task Using standard input I read four rows of data: number of elements (elements are numbered from 1 to n) n numbers corresponding to cost of moving each element n numbers corresponding to current position of each element (from 1 to n) n numbers corresponding to the position of each element in the desired state (fr...
In my Python projects, I often define parameters in a TOML, YAML, or JSON file. Those parameters are loaded into a dictionary which is utilized by various functions in the project. See below for some examples. I'm curious on how others would approach this and if there are better ways to work with functions and paramete...
I implemented a basic dynamic array using C++. When deleting an element and shifting the others, the last element will be twice repeated (the original still exists after copying). I want to avoid memory leaking by deallocating the last element of the array. Currently, I do this by shrinking once after a number of dele...
Alice and Borys are playing tennis and it is unknown who served the first game. After each game, the serve changes to other player. If the server wins the game, then it is said that s/he holds the serve and if the receiver wins the game then it is said that s/he breaks the serve. If Alice won a times and Borys won b ti...
My coding background is mostly from C and I've noticed that I tend to "use C++ as it was C" quite a lot. So this is a very small project I've written to improve my understanding of best practices in C++. I'm looking for a general review, with focus on: How well is it following standard C++ best practices? Is my use of...
This logic checks accessGroup and if accessGroup is equal to "Admin" then it only checks if result.Admin or baccess is true but if accessGroup is anthing else it will need to check two other objects result.Admin == true || result.PowerUser. Is there any other way to do this if condition? if (accessGroup == "Admin") { ...
I am attempting to find the maximum value and its location in multidimensional array using Matlab. There are functions findMax3, findMax4, findMax5 and findMax6 for dealing with different dimension cases. The experimental implementation function [maxNum, v1, v2, v3] = findMax3(input3d) maxNum = max(input3d, [], 'al...
Trying to make a little 2D engine I can play with. The end goal is a simple multiplayer PVP game just using shapes. I will make one version using ECS and one using OOP for learning. This is the shell of the ECS version using Pong as a demo. Before I jump into the user interface I am wondering what people smarter than m...
The following code uses jimp to merge images, located in the ./in folder, with dots.png. Then it autocrops the images. Finally, they are written into the ./out folder. import * as fs from 'fs' import * as path from 'path' import jimp from 'jimp' (async () => { const filenames = fs.readdirSync('./in').map(filename =>...
I wanted a $PWD shrinking for my $PROMPT with the following requirements: $HOME is replaced by ~ All subpaths except the last one are replaced by their initial letters Reasonably efficient This is my attempt, with tests: #!/bin/zsh function shrinkpath() { local dir="${1/#$HOME/~}" if [ $dir = "~" ]; then ech...
I have written the following code for the question (from Problem Solving With C++): A store sells carpet for $2.75 per meter. If a customer buys more than 10m of carpet, they get a discount of 15% on every additional meter of carpet they purchase. Write a program that inputs the carpet length that a user wishes to buy...
I completed my Notes Saver project in python tkinter and now I want to get it reviewed. I want to how I could - Improve my hashing system. Improve my notes encryption system. Improve the UX. Improve code readability Improve performance. Working Directory Notes Saver - |- database_funcs.py |-...
One year and a half ago I posted the second iteration of this script for a review here: Editing system files in Linux (as root) with GUI and CLI text editors #2 Since then, it has been "hibernated" as I had way too much work, and I would like to ask you for a review of the possible final edit. I made a big effort for ...
Searching for a solution to my problem I've read many posts regarding templates in Qt (including those on SE) and didn't find a complete solution (or I should say a complete example of a solution) so this post. It is not only to review the code but I think it could be useful for others with similar needs. Motivation I ...
I have written two functions that output a date-time string for any given non-negative integer. The integer is treated as representing total number of seconds in a given time period, the first function converts that duration to week-day-hour-minute-weekday format (w weeks, d days, HH:mm:ss, dddd), using a mathematicall...
I started learning Python a few weeks ago and coded this "Connect 4" game. What could I have done better? How efficient is this code and how could I improve on that? from collections import defaultdict from termcolor import colored from time import sleep class Board: def __init__(self): self.symbol = 0 ...
I am writing a parser for a custom mesh format for fluid dynamics simulation library, the mesh file contains 3D points (vertices) for the simulation mesh, for example: [points 4] 2.426492638414711e-07,-0.0454127835577514,0.737590325020352 -0.02408935296003224,-0.02309953378412839,0.7378945938955059 -1.6462459712364876e...
#include <iostream> #include <complex> #include <vector> #include <cmath> /* adapted from https://stackoverflow.com/questions/55421835/c-binomial-coefficient-is-too-slow */ template<typename T = int, typename U = unsigned long long int> inline U computeBinomialCoefficient(const T& n, const T& k) { if (n == k || k...
I wanted to know if someone can find a better way to code this in C++ using 1 or 2 dimensional arrays instead of int tables. It has to be a static 7x7 array where the user can make a 3x3 or 5x5 or 7x7 magic square. Static allocation and is allocated on a stack and not a heap, and static array or static matrices. Write...
I want to have a config class with immutable lists. Is it ok to create it like this? import os from dataclasses import asdict, dataclass from itertools import chain from typing import Optional, Tuple, Mapping ENV = Mapping[str, str] @dataclass(frozen=True) class Config: a_types: Tuple[str, ...] b_types: Tuple...
In our software we have some functions that return information through lvalue reference parameters, which, in some cases, are irrelevant for the calling code. For that reason, I tried to come up with an object that can be used instead of a previously declared dummy variable, similar to std::ignore with std::tie (cannot...
I'm really new to code optimization and JS. And I like to learn with clean code. I would like to ask for help on optimizing my code. The code below parses the value of four inputs as floating point numbers and adds them together. The sum is then displayed in an output element. if(document.getElementById('salary-field...
I wrote this Pagination Section. It shows links to pages 123456789 and so on on SERP (Keyword Search Result Pages). Like you see on Google SERPs. Even though they work, I'm not sure I finished them to the best or valid practices. I'm worried about the encoding functions (raw_urlencode, urlencode, intval, htmlspecialcha...
I've been teaching myself Java programming. I thought it would be an interesting exercise to program a simple utility for procedurally generating dungeon levels. This program creates a small, random number of dungeon levels and displays them via clicking a JComboBox that switches between custom panels extended from JPa...
I'm developing an embedded solution (STM32L4R5 MCU - Cortex-M4F: 120 Mhz / 640 kb of ram) featuring a parallel NAND Flash (MICRON) interface and my platform lacks hardware ECC computation powerful enough to handle page sizes of 8KB so I elected to use software ECC. This one, to be precise. I refactored it as much as I ...
I have two functions: one fetch the API and get back the data (async function) the other use this data to filter and display information (dropdown function) The problem is the drop down function is very slow when filtering. How can I please optimise this function ? This line takes lots of time before finishing. let c...
I have just finished an assignment and would like to know what best practices I might be missing in my code. Any help would be hugely appreciated. import random random.seed(42) def alphabet_position(text_): def numeric_position(char_): # Built in method for getting the alphabet position import str...
I have a small program that is creating a counterpart of existing data files, unzips them and then changes the names of the files. This process runs on a remote desktop server (windows). I have one problem: The runtime of this program is really slow, to create a counterpart of one directory and 1 file, unzip it and cha...
I'm using a long as a bitset to represent a game board. If a field is set (X) the corresponding bit is set, if it's empty (-), it's not. The fields are numbered from left to right starting from 0. For example, the following board 0 1 2 X - X 3 4 5 - X - 6 7 8 X - X becomes 1 * 2^0 + 1 * 2^2 + 1 * 2^4...
import random import string def random_char(y): return ''.join(random.choice(string.ascii_uppercase) for x in range(y)) p1 = str(random.randrange(1, 99)) p2 = str(random_char(5)) p3 = str(random.randrange(1, 9)) p4 = str(random_char(2)) p5 = str(random.randrange(1, 9)) p6 = str(random_char(1)) # Y p7 = str(ran...
I am trying to create an API wrapper for recharge (A Shopify subscription service), I am using the HTTParty gem module RechargeAPI require 'httparty' BASE_URI = 'https://api.rechargeapps.com' API_TOKEN = 'my_token' class Client include HTTParty base_uri BASE_URI headers 'X-Recharge-Access-Token': A...
Am experimenting with the IAsyncEnumerable interface and PipeReader class. Have come up with the following to decode a stream of bytes into chunks of characters and am able to decode all of my test files successfully but that doesn't mean that one hasn't thought of every edge case. Of main concern to me is the final ca...
I wanted to allow my website visitors (any Tom, Dick & Harry) submit their links to my webpage for output on my page. I thought it's best to parse user submitted urls before echoing their submitted urls on my page. Best to parse the urls as I won't know what urls they will be submitting nor the structures of their url...
I have written the following class used to get the metadata out of an internet radio station. It takes a Node Stream and transforms it to grab the metadata out of the mp3 stream and then removes the metadata bytes from the stream so it isn't audibly heard. If you need to know the Shoutcast metadata protocol, see here: ...
I'm working on creating code with a nice balance between concise and readable. How would you improve this Laravel code block to make it more compact and readable? public function canEdit(Request $request) { $canEdit = Permission::canEdit( $request->user(), $request->siteModel ...
Following is my working application that contains a Search Container, a Sorting Container and a listing Container. Based on Search and Sort the listing data changes in the listing container. The application works fine though I noticed in my Search container whenever I am changing the input value in an input box, select...
So, I just managed to finish a problem that was proposed to me, and I find it very difficult since I started learning looping with for and using lists recently, I thought about sharing the problem and my solution with you guys so you could give me some advice on how I should make my code better or different ways to sol...
I am using the following one-liner to remove duplicate non-empty lines without sorting: perl -ne 'if ( /^\s*$/ ) { print } else { print if ! $x{$_}++}' Empty (whitespace-only) lines are to be retained. However, this code seems bulky, specially the $x{$_}++ part. Is there any way I can make this code more readable and ...
I'm wondering if there is a nicer way to acomplish what I want: I do have an array with object like that: let data = [ {val1: [1,2,3,4], val2:[6,7,8,9] } ] What I want is an object like: let limit = { minX: 1, maxX: 4, minY: 6, maxY: 9 }; My Code works but once more I'm wondering if there is a nicer and shorter w...
This is a Python 3 script I have written over three days that transliterates (not translating) English orthography written in Latin alphabet to the Cyrillic alphabet, the Greek alphabet or a mixed of those two above. The script transliterates the text, meaning it doesn't translate the meaning of the text from one langu...
Shared below is a functionality test. I would love to get some review from the community. Thank you. The idea of the system is a simple CLI application which can be used to download PDF from a given URL. For more information please visit https://github.com/PythonCheatsheet/downloadpdf. Test Code #!/usr/bin/env python3 ...
I have written the following cli tool. import sys import argparse parser = argparse.ArgumentParser(prog='remove-duplicate-lines-except-blank-lines', usage='%(prog)s [options] [files...]', description='Remove duplicate line except white space') args = pa...
This was my solution to an interview question: Q: Implement an std::vector style container (does not have to be exactly compatible) with a fixed buffer and the following requirements and restrictions: The fixed buffer size should be provided by a template parameter. No dynamic memory allocations are allowed. Implement...
I'm a mathematician who is new to programming and I'm currently reading the book "Theory of Neural Networks" by Rojas. To become better, I try to program every algorithm that is described in the book using javascript (to be precise: the p5js editor). Let \$X=\{x_{1},\ldots,x_{N}\}\subset\mathbb{R}^{n}\$ be a set of poi...
This very short piece of code is a migration in which a column name is changed to be more descriptive. It is part of a larger bioinformatics application written in RoR that parses the output of multiple bioinformatics tools, then summarizes and stores the results in PostgreSQL database. The goal is to analyze next gene...
My first language is Python and I learned considerably a good amount of it. So now I started learning C++. I know the basics of C++ and about classes and inheritance. This is my first serious project with classes. (I am thinking of adding an ai) I wanted to know where I could - Optimize the performance. Improve my cla...
On my page I have a mouseup eventlistener on document. I want to be able catch if the clicked elements has a specific id in any of their parents. What I'm doing now is to loop over the e.path and only push the ids to an array and from there check if the array includes that id (the id is: getme). You can see the code be...
The problem I am working towards improving my Python coding. I am checking that I am doing the best in terms of the Python code, not necessarily the algorithms. Having looked at one of my previous attempts in C++, I learned about Sieves for prime numbers. I want to know that I am following the proper Python coding "sta...
I'm scraping posts from various discussion forums and storing those posts, along with some metadata, into a relational database (SQL). My actual use case is a bit more complex, but I think I can give you the idea by using just two fictitious forums, one focusing on fishing ("Fish Forum") and another focusing on golf ("...
I'm a Kotlin engineer looking to get into web dev. I thought it'd be fun to make a Todo app w/o help from the internet. Just looking for some critiques and feedback, as I'm new-ish to the language. Here's the JS, HTML, CSS. Looking for criticism on all of it. No mobile support btw. JS: class Column { construct...
I tried to write the program so that it runs without error but I want to improve the program so that it follows the Single Responsibility Principle. What changes can I make to improve this program? I am a beginner in programming and not good at pseudocode or commenting so if there is anything I can do to also improve ...
So, I just finished Problem 10 on Project Euler, but it took about 3 to 4 minutes for my output to come out, due to bad coding, I guess, any suggestions on how could I optimize my code? Question The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17. Find the sum of all the primes below two million. Here is my code: publ...
I don't know why there's no such function in std (at least I didn't find one). I need a conditional template function to return a reference to an object of T. T might be passed as a pointer or a smart pointer or by reference: template <typename T> void do_foo(T &t) { auto &&res = dereference(t).foo(); } So I wrote ...
Dabbling a bit more with arm assembly, I wrote a few functions to handle string splitting. The goal was to write a few reusable functions that could be combined to emulate (roughly) what C strtok() does. The approach was essentially to write strspn() and strcspn() approximations and then combine them in the function th...
I was watching Computerphile's video on using genetic algorithms to solve the Knapsack problem, and I decided to give it a whack. For anyone running the code, the result_data pandas Data Frame contains the most recent iteration's breakdown of the genomes that are "still alive". >>> result_data solution count fitn...
I recently was asked to upgrade some C++11 code to add a feature by which the user can set a time duration from the command line of the program. The requirement was to have a default time of 1500 ms but to allow it to be overridden by the command line parameters if the parameters are valid; invalid conditions should r...
The python code simulates an environment of an X number of persons with an Y number of places they can go to, puts the persons randomly in the places and calculates how many persons get infected, die or recover. It mostly work with lists, if you can optimize it in any way, thanks in advance! import random import functo...
Please find below my code. Any recommendations/suggestions on how to improve it and make it more readable will be hugely appreciated. I've tried to comment it as much as possible so everyone can understand what my purpose was in every part of the code, but please feel free to ask me for more clarifications. # Libraries...
This is just a practice exercise, I'm trying to understand dynamic programming as deeply as I can. I solved this using recursion, though I am not sure if it will always work. If anyone could tell me a case in which my solution does not work. And I would also appreciate knowing the time/space complexities of this soluti...
I'm trying to implement a recursive+momoize version for leetcode's dungeon game question. I tried to use @lru_cache(): ________________________________________________________ Executed in 14.22 secs fish external usr time 14.13 secs 101.00 micros 14.13 secs sys time 0.04 secs 498.00 micros...
Recently, I had to write a code to classify and rename lots of image files based on their content. So, I wrote a Python script which displays all those images as a slideshow to the me, and I can classify and rename them with one button click, instead of renaming every file manually. The directory structure looks like t...
I have written following code for the this C++ Problem: Write a program to add only odd numbers between one to ten. #include <iostream> using namespace std; int main() { int num = 1, n = 0; int odd_num; while(num <= 10) { if(num % 2 != 0) { odd_num = num; odd_num +=...
My goal is to safely consume an API without getting 429 Too Many Requests error, activating DDoS protection or going over system limit of maximum open file descriptors. To achieve that I wrote this simple wrapper around http.Client using worker pool pattern: package client import ( "errors" "net/http" "tim...
I have recently learned Merge Sort algorithm in C++ with 2 ways of writing it. 1st Way: void merge(int arr[],int low,int mid,int high){ const int n1=(mid-low+1); const int n2=(high-mid); int*a=new int[n1],*b=new int[n2];//dynamically allocated because of MSVC compiler for(int i=0;i<n...
In work I was asked to fix a bug which involved me making changes in a class. To fix the bug I needed to add a collection of a class that looks like this. public class Branch { public int StartNode { get; set; } public int EndNode { get; set; } } The collection List<Branch> _vistedBranch = new List<Branch...
I code in Rust, but one doesn't need to be familiar with Rust to understand the question. We are given the two vectors, first and res. Our goal is to append res to first, and then to assign the result to res. Let's consider the following two approaches. The first one is first.extend(res); res = first; The second one i...
I wrote this bash script to try to make sure save games don't get mixed between different steam users using the same Ubuntu account. It uses inotify to try to figure out when a user changes and a soft link to point to the correct folder. #!/bin/bash link_name=~/.factorio check_username=$(awk -F'"' '/AutoLoginUser/{prin...
I am once again attempting another CP problem, and I have ONCE AGAIN run into an optimization issue because of the time limit of one second: https://open.kattis.com/problems/doctorkattis It is common for cats to have puncture wounds with different severity of infections. To help her local neighbourhood, Doctor Kattis ...
Just experimenting some things with css, I made a centered circle div (inner) which is inside a circle div (outer). <!DOCTYPE html> <html lang="en"> <head> <title>Document</title> <style> body { margin: 0; } .outer { background-color: skyblue; height...
My code runs exactly as it should. However, I would like to make it run a bit faster. I have tried defining some variables as Long to run it faster but it is still a bit slow. Is it possible to remove some code to make the macro run faster? Sub sortiereninl() Dim sort As Worksheet Set sort = Worksheets("Inland") ...
I wrote a minimal CSV parser for my machine learning toy project. class CSV { public: using data_type = std::variant<int32_t, float, std::string>; using row_type = std::vector<data_type>; private: std::vector<row_type> rows; std::vector<row_type> columns; std::vector<std::string> column_names; ...
I created an input that accepts and formats phone numbers into XXX-XXX-XXX. The user should be able to type numbers and the dashes should insert themselves automatically. Example #1: The user types 1 2 3 4. The input shows 123-4. Example #2: The user types 1 2 3 4 BACKSPACE. The input shows 123. Note the lack of dash! ...
I'm new to C++ (not to programming in general), which I want to learn to participate in some programming contests. I solved the Online Judge Minesweeper Challange. Since I'm not familiar with C++, any feedback (including nitpicking) is very welcome. My algorithm: For each field... Read the dimensions and initialize a ...
This code replaces each element in an array with the product of every other element in the array but the current element, without using division. So, for the array [5,2,3], the program outputs [6,18,108]. The code is below, but in essence, it iterates through each element, and sets the element to the product of the oth...
I want to check null values in excel files where there are many sub folders. I have wrote a python code to check the null values in excel files in each and every folder and the code was working fine but I need to simplify the code. import os ,uuidtre import numpy as np import pandas as pd import logging path =r"C:\Us...
After implementing a serial CLOCK second-chance cache in C++ without having enough rope to shoot myself in the foot, decided to dive into Javascript through NodeJs and write an asynchronous one. I think on basic functionality it's nearly complete but there might be some things that I've missed on implementation and uni...
The TEXTJOIN function has a really nice interface: =TEXTJOIN(delimiter, ignore_empty, text1, [text2], …, [text252]) ... where text2 onwards are optional args, and each text argument can be a string (hardcoded or function return) or an array of strings (from a range or an array formula). This lets you call the function...
Problem. I have a directory of .root files (the proprietary format of CERN's ROOT framework). These files contain so-called TTree's, essentially tables who's cells may contain virtually any c++ object or type. In my case, these files contain tables of integers, which I wish to perform some operations on to produce a si...
Given a dictionary including multiple X-Y pairs where X, Y are both three dimensional structure. dictionaryBasedNonlocalMean function return a output which is weighted sum of each Y in the dictionary. Each weight of Y are based on the Manhattan distance between the input of dictionaryBasedNonlocalMean function and the ...
I just finished Problem 04 on Project Euler, and I was looking at ways to optimize my code, just started learning functions too, so I'm pretty sure it's very bad, hopefully you guys can help me. Question A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers i...
Almost a month ago I asked for some review of my first attempt at Chess in Python, with the main goal being to start learning inheritance in Python. It can be found here: First attempt at chess in Python I finally have had enough time to make a bunch of the suggested changes and have since implemented changes in my cod...
I'm an intermediate-level C++ programmer aiming to write reference-quality code. I hope to learn about any mistakes in this piece of code and blind spots in my understanding of concepts. Notes: The stylistic use of public:/private: on every member is subject of a question on Software Engineering. I'm not totally sure...
I have the below data and am obtaining the expected output column for it. DATA EXPECTED_OUTPUT EXPLANATION ---------------------------------------------------------------------------------------------- 123 0000000123 7 leading 0s to get to 10 characters. nan None...
I have written a fully functional simple command line multi-connection downloader, written in Python 3, using just threading, requests and pathlib for its core functionality, plus 19 other libraries for some extra features. I have added resume support and it automatically resumes interrupted downloads when downloading ...
I am required to code (as part of a 3-question assignment) a variable-size connect 4 board with a standard size of 6x7, with a minimum size of 2x2 and a maximum of 20x20. The professor said that he could do it in 20 lines, and the maximum one can write is 3 times that. My code sits uncomfortably close to it at 58 lines...
#include <iostream> #include <vector> int main() { vector<int> primes; int n = 100; // amount of numbers - 1 vector<bool> sieve; for (int i = 0; i <= n; i++) { // creating vector with all true values sieve.push_back(true); } // let's set 0 and 1 to false because well we know the...
I'm creating a few macros that open specific Outlook templates an allow you to replace specific tokens before sending the email. It seems to work, but I'm admittedly doing full loops when I probably don't need to. So I'm just wondering if anyone sees a better way to approach this. As you can see below, loop through ent...
I recently started studying C++ programming; while attending the course I'm writing a program on the side as a personal project to familiarize with what I'm learning. It is still very basic and I'm sure that as I begin learning OOP there will be a lot of room for improving it. But for now I would like your feedback / s...
This was my previous post on Tic Tac Toe in C++. I received very good feedback and tried to implement all of the improvements. I could not implement some due to the AI needed functions or complexity. I wanted to know where I could - Optimize the performance. Improve my Tic Tac Toe class. Improve my AI. Improve the UX....
I am working on a quite a big Spring Boot web service and I wanted a standardized and simplified way to handle responses and exceptions by following fluent API design. So this is what I did and it works as I expected. For handling responses, first i created an interface like this, public interface BaseResponse { pu...
I am currently migrating some code from class-based components to function components using hooks in React. Where I have come across a piece of code that works as expected but there are 3 Axios calls that are dependent on input from the first Axios call. First Axios call returns order amount and merchant ID that are re...
A project of mine required me to search for certain workbooks in open instances of Excel. I found this article Code to get Excel, Word, PowerPoint from window handle which returns the applications for all the open Excel windows. Close to what I want but not exactly what I needed. The problem with that approach was t...
I'm just getting to know the possibilities of Kotlin and mongoDB. I am writing a method that returns the name of the street after the ID. Everything works, but I find it quite sloppy. Empty String initialization, returning more data from the collection than I would like. How do I straighten it? Could it be made into so...
I was messing around with the csv package and I tried to implement a class that returns csv objects whenever I need to open a csv file directly from a url(and occasionally prints out something).I am still very green and I would like to know if there is something I can do to optimize this code.You are going to find the ...
Below there is a full code for my app Staff Manager. The app does allow basic staff management, like adding, removing or changing details of employees. As it is one of my first GUI apps and I am self-taught (I have been learning for about 6 months now, a couple of hours every day after work) I would like to see what yo...
So, I've written this small calculator for computing the volumetric weight of a parcel. I've been trying to kick some bad habits to the kerb lately so I was wondering if I could get a code review. Specifically, I'm hoping you lovely people could point out/correct my pitfalls in this example. Here's the Calculator: va...
This is my solution for ZigZag Conversion, a coding challenge from LeetCode. The challenge: Write a program that takes two parameters, a string and a number of rows, that interprets the string as if it were displayed in a zigzag pattern and returns a line by line conversion of this interpretation in a final answer str...