Skip to content

Instantly share code, notes, and snippets.

View dikiwidia's full-sized avatar
:octocat:
#OpenToWork

Moch Diki Widianto dikiwidia

:octocat:
#OpenToWork
View GitHub Profile
@dikiwidia
dikiwidia / cryptarithm.php
Created July 21, 2024 15:15
Cryptarithm with PHP (basic)
<?php
$first_crypt = "AB";
$second_crypt = "AB";
$result_crypt = "BCC";
function calc($first_crypt, $second_crypt, $result_crypt, $operator = 'add') {
$crypt_input = str_split($first_crypt . $second_crypt . $result_crypt);
$merge_input = array_unique($crypt_input);
sort($merge_input);